Repeatedly inserts vertices as mid points of the longest edges until the
new vertex count is reached.
@param {Number} count new vertex count
@return itself
772618
function( count ){
            var num = this.vertices.length,
                longestID = 0,
                maxD = 0,
                i = 0,
                d,
                m;

            while( num < count ){
                //find longest edge
                longestID = 0;
                maxD = 0;
                for( i=0; i<num; i++ ){
                    d = this.vertices[i].distanceToSquared( this.vertices[ (i+1) % num ] );
                    if( d > maxD ){
                        longestID = i;
                        maxD = d;
                    }
                }
                //insert mid point of longest segment
                m = this.vertices[longestID]
                    .add(this.vertices[(longestID + 1) % num])
                    .scaleSelf(0.5);
                //push this into the array inbetween the 2 points
                this.vertices.splice( longestID+1, 0, m );
                num++;
            }
            return this;
        }
295507
function insertRow(
    opts: Options,
    change: Change,
    at?: number, // row index
    getRow?: (columns: number) => Block // Generate the row yourself
) {
    const { value } = change;
    const { startKey } = value;

    const pos = TablePosition.create(opts, value.document, startKey);
    const { table } = pos;

    // Create a new row with the right count of cells
    const columns = table.nodes.get(0).nodes.size;
    const newRow = getRow ? getRow(columns) : createRow(opts, columns);

    if (typeof at === 'undefined') {
        at = pos.getRowIndex() + 1;
    }

    return change
        .insertNodeByKey(table.key, at, newRow)
        .collapseToEndOf(newRow.nodes.get(pos.getColumnIndex()));
}
417526
function (domElt, count) {
            if (count == null) {
                count = 1;
            }
            while (domElt && count > 0) {
                domElt = domElt.previousSibling;
                if (domElt && domElt.nodeType == 1) {
                    count--;
                }
            }
            return domElt;
        }
689770
public @NotNull QueryBuilder appendPlaceholders(int count) {
        if (count <= 0) throw new IllegalArgumentException("count must be positive, but was: " + count);

        query.append('?');
        for (int i = 1; i < count; i++)
            query.append(",?");

        return this;
    }

    /**
     * Adds placeholders for all elements of collection and then adds then values
     * of collection itself.
     */
    public @NotNull QueryBuilder appendPlaceholders(@NotNull Collection<?> args) {
        appendPlaceholders(args.size());
        addArguments(args);

        return this;
    }

    /**
     * Is the query string empty?
     */
    public boolean isEmpty() {
       return query.length() == 0;
    }

    /**
     * Does this query have any arguments?
     */
    public boolean hasArguments() {
        return !arguments.isEmpty();
    }

    /**
     * Adds an argument to this query.
     */
    public @NotNull QueryBuilder addArgument(@Nullable Object argument) {
        arguments.add(argument);
        return this;
    }

    /**
     * Adds given arguments to this query.
     */
    public @NotNull QueryBuilder addArguments(Object... args) {
        return addArguments(asList(args));
    }

    /**
     * Adds given arguments to this query.
     */
    public @NotNull QueryBuilder addArguments(@NotNull Collection<?> args) {
        arguments.addAll(args);
        return this;
    }

    /**
     * Builds an SQL query from the current state of this builder.
     *
     * @throws IllegalStateException if the builder is empty
     */
    public @NotNull SqlQuery build() {
        if (query.length() == 0)
            throw new IllegalStateException("empty query");

        return SqlQuery.query(query.toString(), new ArrayList<>(arguments));
    }
}
248973
function () {
        if (!this.vertexCount) {
            return;
        }

        var indices = this.indices;
        var attributes = this.attributes;
        var positions = attributes.position.value;
        var normals = attributes.normal.value;

        if (!normals || normals.length !== positions.length) {
            normals = attributes.normal.value = new vendor.Float32Array(positions.length);
        }
        else {
            // Reset
            for (var i = 0; i < normals.length; i++) {
                normals[i] = 0;
            }
        }

        var p1 = vec3Create();
        var p2 = vec3Create();
        var p3 = vec3Create();

        var v21 = vec3Create();
        var v32 = vec3Create();

        var n = vec3Create();

        var len = indices ? indices.length : this.vertexCount;
        var i1, i2, i3;
        for (var f = 0; f < len;) {
            if (indices) {
                i1 = indices[f++];
                i2 = indices[f++];
                i3 = indices[f++];
            }
            else {
                i1 = f++;
                i2 = f++;
                i3 = f++;
            }

            vec3Set$2(p1, positions[i1*3], positions[i1*3+1], positions[i1*3+2]);
            vec3Set$2(p2, positions[i2*3], positions[i2*3+1], positions[i2*3+2]);
            vec3Set$2(p3, positions[i3*3], positions[i3*3+1], positions[i3*3+2]);

            vec3.sub(v21, p1, p2);
            vec3.sub(v32, p2, p3);
            vec3.cross(n, v21, v32);
            // Already be weighted by the triangle area
            for (var i = 0; i < 3; i++) {
                normals[i1*3+i] = normals[i1*3+i] + n[i];
                normals[i2*3+i] = normals[i2*3+i] + n[i];
                normals[i3*3+i] = normals[i3*3+i] + n[i];
            }
        }

        for (var i = 0; i < normals.length;) {
            vec3Set$2(n, normals[i], normals[i+1], normals[i+2]);
            vec3.normalize(n, n);
            normals[i++] = n[0];
            normals[i++] = n[1];
            normals[i++] = n[2];
        }
        this.dirty();
    }
466882
private int insertTailoredNodeAfter(int index, int strength) {
        assert(0 <= index && index < nodes.size());
        if(strength >= Collator.SECONDARY) {
            index = findCommonNode(index, Collator.SECONDARY);
            if(strength >= Collator.TERTIARY) {
                index = findCommonNode(index, Collator.TERTIARY);
            }
        }
        // Postpone insertion:
        // Insert the new node before the next one with a strength at least as strong.
        long node = nodes.elementAti(index);
        int nextIndex;
        while((nextIndex = nextIndexFromNode(node)) != 0) {
            node = nodes.elementAti(nextIndex);
            if(strengthFromNode(node) <= strength) { break; }
            // Skip the next node which has a weaker (larger) strength than the new one.
            index = nextIndex;
        }
        node = IS_TAILORED | nodeFromStrength(strength);
        return insertNodeBetween(index, nextIndex, node);
    }
264855
public SortingParams limit(final int start, final int count) {
    params.add(LIMIT.raw);
    params.add(Protocol.toByteArray(start));
    params.add(Protocol.toByteArray(count));
    return this;
  }
423626
function( mode, count, offset ){
    count  = ( count === undefined  ) ? this.size/this.typeSize : count;
    this.gl.drawElements( mode, count, this.type, 0|offset );
  }
270710
function link(edge) {
  var es = edge.s.euler
  var et = edge.t.euler
  var euler = new Array(edge.level+1)
  for(var i=0; i<euler.length; ++i) {
    if(es.length <= i) {
      es.push(createEulerVertex(edge.s))
    }
    if(et.length <= i) {
      et.push(createEulerVertex(edge.t))
    }
    euler[i] = es[i].link(et[i], edge)
  }
  edge.euler = euler
}
467080
function _createParticles(node, count) {
        this._particles = [];
        var options = {
            size: [this.options.particleSize, this.options.particleSize],
            properties: {
                backgroundColor: this.options.color,
                borderRadius: '50%'
            }
        };
        for (var i = 0; i < count; i++) {
            var particle = {
                surface: new Surface(options),
                mod: new Modifier({})
            };
            this._particles.push(particle);
            node.add(particle.mod).add(particle.surface);
        }
    }
1150811
public VideoMultipleWrapper selectCount(@IntRange(from = 1, to = Integer.MAX_VALUE) int count) {
        this.mLimitCount = count;
        return this;
    }
1267664
function addConnectedEdges(node) {
    var edges = node._private.edges;

    for (var i = 0; i < edges.length; i++) {
      add(edges[i]);
    }
  }
496941
public final void insertNullElementsAt(int index, int count)
  {
    if (tc.isEntryEnabled())
      SibTr.entry(
        tc,
        "insertNullElementsAt",
        new Object[] { new Integer(index), new Integer(count)});

    for (int i = index; i < index + count; i++)
      add(i, null);

    if (tc.isEntryEnabled())
      SibTr.exit(tc, "insertNullElementsAt");
  }
1013997
public void incrementCount(List<K> l, K o, double count) {
    if (l.size() != depth - 1) {
      wrongDepth();
    }

    GeneralizedCounter<K> next = this;
    for (K o2: l) {
      next.addToTotal(count);
      next = next.conditionalizeHelper(o2);
    }
    next.addToTotal(count);

    next.incrementCount1D(o, count);
  }
865938
def create(self, count):
        """"""
        space, self.space = tee(self.space)
        limit = reduce(mul, map(len, self.sets)) * self.position
        logging.debug('limit: %s', limit)
        if limit >= count:
            return ''.join(islice(space, count))
        else:
            raise IndexError('{count} Overflows {sets}!'.format(
                count=count, sets=self.sets))
184672
public long count(BoundingBox boundingBox) {
		GeometryEnvelope envelope = boundingBox.buildEnvelope();
		long count = count(envelope);
		return count;
	}
748712
public synchronized SamplerResult<T> finishSampling(int count)
    {
        List<Counter<T>> results = Collections.EMPTY_LIST;
        long cardinality = 0;
        if (enabled)
        {
            enabled = false;
            results = summary.topK(count);
            cardinality = hll.cardinality();
        }
        return new SamplerResult<T>(results, cardinality);
    }