code stringlengths 114 1.05M | path stringlengths 3 312 | quality_prob float64 0.5 0.99 | learning_prob float64 0.2 1 | filename stringlengths 3 168 | kind stringclasses 1
value |
|---|---|---|---|---|---|
package org.apache.spark.graphx.lib;
/**
* PageRank algorithm implementation. There are two implementations of PageRank implemented.
* <p>
* The first implementation uses the standalone <code>Graph</code> interface and runs PageRank
* for a fixed number of iterations:
* <pre><code>
* var PR = Array.fill(n)( 1.0 )... | graphx/target/java/org/apache/spark/graphx/lib/PageRank$.java | 0.918388 | 0.465023 | PageRank$.java | starcoder |
package com.opengamma.engine.depgraph;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Iterator;
import org.apache.commons.lang.ObjectUtils;
import com.opengamma.engine.ComputationTargetSpecification;
import com.opengamma.engine.target.ComputationTargetReference;
import com.opengamma.engine.ta... | projects/OG-Engine/src/main/java/com/opengamma/engine/depgraph/OrderedRunQueue.java | 0.797399 | 0.486149 | OrderedRunQueue.java | starcoder |
package com.github.ducoral.tiziu;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.List;
abstract class Tree {
abstract Object evaluate(Evaluator evaluator);
static class Binary extends Tree {
final Tree left;
final String operator;
final Tree right;
... | src/main/java/com/github/ducoral/tiziu/Tree.java | 0.931517 | 0.503723 | Tree.java | starcoder |
package org.modeshape.jcr.query.model;
import org.modeshape.common.annotation.Immutable;
import org.modeshape.common.util.CheckArg;
import org.modeshape.common.util.HashCode;
import org.modeshape.common.util.ObjectUtil;
/**
* A join condition that tests whether two nodes are the same nodes (that is, have the same id... | modeshape-jcr/src/main/java/org/modeshape/jcr/query/model/SameNodeJoinCondition.java | 0.908952 | 0.522202 | SameNodeJoinCondition.java | starcoder |
package com.microsoft.recognizers.text.number.resources;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import com.google.common.collect.ImmutableMap;
public class FrenchNumeric {
public static final String LangMarker = "Fr";
public static final String RoundNumberIntegerRegex = "(ce... | Java/libraries/recognizers-text-number/src/main/java/com/microsoft/recognizers/text/number/resources/FrenchNumeric.java | 0.538983 | 0.716938 | FrenchNumeric.java | starcoder |
package April2021Leetcode;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
public class _1001GridIllumination {
public static void main(String[] args) {
System.out.println(Arrays.toString(gridIllumination(5, new int[][] { new int[] { 0, 0 }, new int[] { 4, 4 } },
new int[][] { new... | src/April2021Leetcode/_1001GridIllumination.java | 0.507812 | 0.462109 | _1001GridIllumination.java | starcoder |
package java.beans;
/**
** BeanInfo can be implemented in order to provide explicit information to the Introspector.
**
** When you write a BeanInfo class, you implement this interface
** and provide explicit information by returning a non-null
** value from the appropriate method. If you wish the
** Introspect... | classpath-0.98/java/beans/BeanInfo.java | 0.845209 | 0.533154 | BeanInfo.java | starcoder |
package info.ata4.bspsrc.util;
import info.ata4.bsplib.struct.BspData;
import info.ata4.bsplib.struct.DBrush;
import info.ata4.bsplib.struct.DBrushSide;
import info.ata4.bsplib.struct.DOccluderPolyData;
import info.ata4.bsplib.vector.Vector3f;
import java.util.Optional;
import java.util.Set;
import java.util.stream.C... | src/main/java/info/ata4/bspsrc/util/VectorUtil.java | 0.770896 | 0.513242 | VectorUtil.java | starcoder |
public class Solution {
public int solve(ArrayList<Integer> A, int B, int C) {
Integer cDigitCount = (int)Math.log10(C)+1;
if(B > cDigitCount) {
return 0;
} else if(B < cDigitCount) {
Integer N = A.size();
if(N == 0) {
... | programming/math/numbers-of-length-n-and-value-less-than-k.java | 0.516352 | 0.507934 | numbers-of-length-n-and-value-less-than-k.java | starcoder |
package dgraph;
/*
* DAGraphTest.java
*
* Copyright: 2013-2014 <NAME>, France
*
* License: http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html CeCILL-B license
*
* This file is part of java-lattices, free package. You can redistribute it and/or modify
* it under the terms of CeCILL-B license.
*/
impo... | test/dgraph/DAGraphTest.java | 0.869673 | 0.620392 | DAGraphTest.java | starcoder |
package cn.edu.gxust.jiweihuang.filature.bave.fitting;
import cn.edu.gxust.jiweihuang.filature.bave.qvlmodel.QVLBave;
import org.hipparchus.fitting.AbstractCurveFitter;
import org.hipparchus.fitting.WeightedObservedPoint;
import org.hipparchus.linear.DiagonalMatrix;
import org.hipparchus.optim.nonlinear.vector.leasts... | src/main/java/cn/edu/gxust/jiweihuang/filature/bave/fitting/QVLBaveFitter.java | 0.93638 | 0.560192 | QVLBaveFitter.java | starcoder |
package io.github.achacha.decimated.decimate;
import io.github.achacha.decimated.StackTraceUtil;
import java.util.Random;
import java.util.concurrent.ConcurrentHashMap;
public final class Decimated {
/**
* Container that maps location to executor data
*/
private final static ConcurrentHashMap<Strin... | src/main/java/io/github/achacha/decimated/decimate/Decimated.java | 0.869604 | 0.421492 | Decimated.java | starcoder |
package org.apache.fop.util;
import java.awt.geom.AffineTransform;
/**
* Utility class for unit conversions.
* @deprecated use org.apache.xmlgraphics.util.UnitConv instead.
*/
public final class UnitConv {
private UnitConv() {
}
/**
* conversion factory from millimeters to inches.
* @depre... | fop-core/src/main/java/org/apache/fop/util/UnitConv.java | 0.936176 | 0.60472 | UnitConv.java | starcoder |
package org.sosy_lab.cpachecker.cpa.smg.join;
import java.util.HashSet;
import java.util.Set;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.sosy_lab.cpachecker.cfa.types.MachineModel;
import org.sosy_lab.cpachecker.cfa.types.c.CType;
import org.sosy_lab.cpachecker.cpa.smg.Anonymo... | src/org/sosy_lab/cpachecker/cpa/smg/join/SMGJoinFieldsTest.java | 0.749362 | 0.506958 | SMGJoinFieldsTest.java | starcoder |
package Autonomous.ImageProcessing;
import android.graphics.Bitmap;
import android.graphics.Color;
import java.util.ArrayList;
/**
* Created by robotics on 12/12/17.
*/
/*
A class to process images and mainly find the columns of the cryptobox
*/
public class CryptoBoxColumnImageProcessor {
public int im... | TeamCode/src/main/java/Autonomous/ImageProcessing/CryptoBoxColumnImageProcessor.java | 0.786623 | 0.596551 | CryptoBoxColumnImageProcessor.java | starcoder |
package com.netty.network.channel.group;
import com.netty.network.channel.Channel;
import com.netty.network.channel.ServerChannel;
/**
* Helper class which provides often used {@link ChannelMatcher} implementations.
*/
public final class ChannelMatchers {
private static final ChannelMatcher ALL_MATCHER = new ... | src/main/java/com/netty/network/channel/group/ChannelMatchers.java | 0.955475 | 0.50354 | ChannelMatchers.java | starcoder |
package frc.robot;
/**
* The RobotMap is a mapping from the ports sensors and actuators are wired into
* to a variable name. This provides flexibility changing wiring, makes checking
* the wiring easier and significantly reduces the number of magic numbers
* floating around.
*/
public class Constants {
// If y... | src/main/java/frc/robot/Constants.java | 0.711832 | 0.619644 | Constants.java | starcoder |
package org.lwjgl.assimp;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.Checks.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.MemoryStack.*;
/**
* An {@code AnimMesh} is an attachment to an {@link AIMesh}... | modules/lwjgl/assimp/src/generated/java/org/lwjgl/assimp/AIAnimMesh.java | 0.89217 | 0.481454 | AIAnimMesh.java | starcoder |
package org.axonframework.common;
import java.util.Optional;
import java.util.function.Predicate;
/**
* Exception utility methods.
*
* @author <NAME>
*/
public abstract class ExceptionUtils {
private ExceptionUtils() {
}
/**
* Checks if the given {@code exception} matches the given {@code predi... | core/src/main/java/org/axonframework/common/ExceptionUtils.java | 0.932346 | 0.41834 | ExceptionUtils.java | starcoder |
package com.linkedin.dagli.tuple;
import java.util.function.IntFunction;
/**
* A tuple of arity 19 that is backed by an array.
* ArrayTuples are less memory-efficient than FieldTuples because they require storing an extra object (the array),
* but are trivially cheap to create from an existing array of tuple elem... | tuple/src/template/generated/com/linkedin/dagli/tuple/ArrayTuple19.java | 0.886027 | 0.442516 | ArrayTuple19.java | starcoder |
package com.example.practice.common;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import java.util.*;
public class ListUtil2 {
public static boolean isEqualList(final Collection<?> list1, final Collection<?> list2) {
if (list1 == list2) return true;
if (list1 == nu... | algorithm_practice/src/main/java/com/example/practice/common/ListUtil2.java | 0.773259 | 0.492859 | ListUtil2.java | starcoder |
package com.univocity.trader.indicators.base;
import java.time.*;
import java.util.concurrent.*;
public class TimeInterval {
public static final TimeInterval MINUTE = minutes(1);
public static final TimeInterval HOUR = hours(1);
public final long duration;
public final TimeUnit unit;
public final long ms;
pri... | univocity-trader-core/src/main/java/com/univocity/trader/indicators/base/TimeInterval.java | 0.873066 | 0.493592 | TimeInterval.java | starcoder |
package name.martingeisse.stackd.common.cubetype;
import name.martingeisse.stackd.common.StackdConstants;
import name.martingeisse.stackd.common.geometry.AxisAlignedDirection;
import name.martingeisse.stackd.common.geometry.RectangularRegion;
/**
* Captures information about all cubes using the same cube type
* ind... | name.martingeisse.stackd-core-common/src/main/java/name/martingeisse/stackd/common/cubetype/CubeType.java | 0.915403 | 0.720626 | CubeType.java | starcoder |
package org.onlab.util;
public final class HexString {
private HexString() {
}
/**
* Convert a byte array to a colon-separated hex string.
*
* @param bytes byte array to be converted
* @return converted colon-separated hex string, e.g. "0f:ca:fe:de:ad:be:ef",
* or "(null)... | utils/misc/src/main/java/org/onlab/util/HexString.java | 0.925811 | 0.465205 | HexString.java | starcoder |
package com.google.j2cl.transpiler.ast;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Preconditions.checkState;
import java.util.function.Function;
/** A primitive type. */
public class Primitive... | transpiler/java/com/google/j2cl/transpiler/ast/PrimitiveTypeDescriptor.java | 0.942652 | 0.402568 | PrimitiveTypeDescriptor.java | starcoder |
package edu.neu.ccs.pyramid.multilabel_classification;
import edu.neu.ccs.pyramid.calibration.*;
import edu.neu.ccs.pyramid.classification.logistic_regression.LogisticRegression;
import edu.neu.ccs.pyramid.dataset.IdTranslator;
import edu.neu.ccs.pyramid.dataset.LabelTranslator;
import edu.neu.ccs.pyramid.dataset.Mult... | core/src/main/java/edu/neu/ccs/pyramid/multilabel_classification/BRLRInspector.java | 0.502197 | 0.437463 | BRLRInspector.java | starcoder |
package java.security.spec;
import java.math.BigInteger;
import java.util.Objects;
/**
* This class specifies an RSA multi-prime private key, as defined in the
* <a href="https://tools.ietf.org/rfc/rfc8017.txt">PKCS#1 v2.2</a> standard
* using the Chinese Remainder Theorem (CRT) information values
* for efficienc... | src/cn/codezlw/source/java/security/spec/RSAMultiPrimePrivateCrtKeySpec.java | 0.947527 | 0.449091 | RSAMultiPrimePrivateCrtKeySpec.java | starcoder |
package com.lipiji.mllib.utils;
import org.jblas.DoubleMatrix;
import org.jblas.MatrixFunctions;
public class LossFunction {
// -( q_ilog(p_i) + (1 - q_i)log(1 - p_i) )
// p is the prediction
private static double crossEntropy(DoubleMatrix p, DoubleMatrix q) {
for (int i = 0; i < p.length; i++) {... | src/main/java/com/lipiji/mllib/utils/LossFunction.java | 0.650689 | 0.498962 | LossFunction.java | starcoder |
package georegression.fitting.polygon;
import georegression.struct.point.Point2D_F64;
import georegression.struct.shapes.Polygon2D_F64;
import org.ddogleg.sorting.QuickSortComparator;
import org.ddogleg.struct.FastAccess;
import org.ddogleg.struct.FastArray;
import java.util.Comparator;
/**
* Finds the convex hull ... | main/src/georegression/fitting/polygon/ConvexHullGrahamScan_F64.java | 0.889211 | 0.620133 | ConvexHullGrahamScan_F64.java | starcoder |
package org.apache.isis.applib.annotation;
import javax.xml.bind.annotation.XmlRootElement;
/**
* The different sorts of domain objects recognized by Isis.
*
* <p>
* Note that {@link #EXTERNAL_ENTITY} and {@link #VIEW_MODEL} are implemented identically internally; the
* difference is one of intent.
* </... | api/applib/src/main/adoc/modules/applib-ant/examples/annotation/Nature.java | 0.871133 | 0.410106 | Nature.java | starcoder |
package graphql.schema;
import graphql.AssertException;
import graphql.Internal;
import graphql.PublicApi;
import graphql.language.EnumTypeDefinition;
import graphql.language.EnumValue;
import graphql.util.TraversalControl;
import graphql.util.TraverserContext;
import java.util.ArrayList;
import java.util.LinkedHash... | src/main/java/graphql/schema/GraphQLEnumType.java | 0.938039 | 0.490358 | GraphQLEnumType.java | starcoder |
package org.tribuo.interop.tensorflow;
import com.oracle.labs.mlrg.olcut.config.Configurable;
import com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance;
import com.oracle.labs.mlrg.olcut.provenance.Provenancable;
import org.tribuo.Example;
import org.tribuo.ImmutableFeatureMap;
import org.tribuo.Output;
... | Interop/Tensorflow/src/main/java/org/tribuo/interop/tensorflow/FeatureConverter.java | 0.907836 | 0.591517 | FeatureConverter.java | starcoder |
package edu.jab.math;
import static org.assertj.core.api.Assertions.assertThat;
import java.math.BigDecimal;
import java.time.Duration;
import java.time.Instant;
import java.util.Comparator;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import java.util.... | src/main/java/edu/jab/math/Problem20220110.java | 0.842507 | 0.58258 | Problem20220110.java | starcoder |
package org.optaplanner.examples.cheaptime.solver.score;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
import org.optaplanner.core.api.score.buildin.hardmediumsoftlong.HardMediumSoftLongScore;
import org.optaplanner.core.api.score.co... | optaplanner-examples/src/main/java/org/optaplanner/examples/cheaptime/solver/score/CheapTimeIncrementalScoreCalculator.java | 0.693888 | 0.404037 | CheapTimeIncrementalScoreCalculator.java | starcoder |
package Sets;
import GrammarNotions.Grammar.CGrammar;
import java.util.BitSet;
/**
*
* @author ssanyu
*/
public class IntAlphabet {
/**
*
*/
protected BitSet FMembers;
/**
* Constructs an empty set of Integers.
*
*/
public IntAlphabet()
{
FMembers = new BitSet();
}
/**
... | src/Sets/IntAlphabet.java | 0.712532 | 0.430866 | IntAlphabet.java | starcoder |
package com.continuent.tungsten.replicator.dbms;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import com.continuent.tungsten.replicator.dbms.RowChangeData.ActionType;
/**
* Holds metadata and data for a row change set, which is a change of a unique
* type (INSERT/UPDATE/DELETE... | tungsten-replicator/replicator/src/java/com/continuent/tungsten/replicator/dbms/OneRowChange.java | 0.894179 | 0.442576 | OneRowChange.java | starcoder |
package q400;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.PriorityQueue;
import org.junit.runner.RunWith;
import util.runner.Answer;
import util.runner.LeetCodeRunner;
import util.runner.TestData;
import util.ru... | src/main/java/q400/Q373_FindKPairsWithSmallestSums.java | 0.875041 | 0.548976 | Q373_FindKPairsWithSmallestSums.java | starcoder |
package fiji.plugin.trackmate;
import java.awt.Polygon;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import fiji.plugin.trackmate.detection.SpotDetectorFactory;
import fiji.plugin.trackmate.features.FeatureAnalyzer;
import fiji.plugin.tr... | src/main/java/fiji/plugin/trackmate/Settings.java | 0.735547 | 0.404743 | Settings.java | starcoder |
package deepboof.visualization;
import org.ejml.data.DenseMatrix64F;
import java.util.List;
/**
* Stores a confusion matrix of results in an N by N double row-major matrix and provides functions for computing
* different statistical properties. To compute different statistical properties first invoke {@link #prec... | modules/visualization/src/main/java/deepboof/visualization/ConfusionFraction.java | 0.915316 | 0.627509 | ConfusionFraction.java | starcoder |
package org.ssgwt.client.validation.validators;
/**
* String regex validator class.
*
* This class is used to validate values with certain regex patterns
*
* @author <NAME> <<EMAIL>>
* @since 02 July 2012
*/
public class StringRegexValidator extends AbstractValidator implements
ValidatorInterface<String... | src/org/ssgwt/client/validation/validators/StringRegexValidator.java | 0.743541 | 0.500305 | StringRegexValidator.java | starcoder |
package org.greenbuttonalliance.espi.common.utils;
import org.apache.xerces.util.DatatypeMessageFormatter;
import javax.xml.datatype.DatatypeConstants;
import javax.xml.datatype.Duration;
import javax.xml.datatype.XMLGregorianCalendar;
import java.io.IOException;
import java.io.Serializable;
import java.math.BigDecim... | src/main/java/org/greenbuttonalliance/espi/common/utils/DurationImpl.java | 0.881538 | 0.409516 | DurationImpl.java | starcoder |
package engine.world.util;
import engine.math.BlockPos;
import org.joml.Vector3fc;
import org.joml.Vector3i;
import java.util.Iterator;
/**
* https://stackoverflow.com/questions/12367071/how-do-i-initialize-the-t-variables-in-a-fast-voxel-traversal-algorithm-for-ray
*/
public final class RayTraceUtils {
publi... | game-engine/src/main/java/engine/world/util/RayTraceUtils.java | 0.863291 | 0.498108 | RayTraceUtils.java | starcoder |
import java.awt.geom.Point2D;
import java.lang.Math;
/**
* An extension to the relatively impotent java.awt.geom.Point2D.Double,
* Vector2D allows mathematical manipulation of 2-component vectors.
*
* @author <NAME>
* @version 20031122
*/
public class Vector2D extends Point2D.Double {
/*
* (non-Javado... | src/agar/Vector2D.java | 0.932499 | 0.766905 | Vector2D.java | starcoder |
package com.google.cloud.translate.v3beta1;
public interface BatchDocumentOutputConfigOrBuilder extends
// @@protoc_insertion_point(interface_extends:google.cloud.translation.v3beta1.BatchDocumentOutputConfig)
com.google.protobuf.MessageOrBuilder {
/**
* <pre>
* Google Cloud Storage destination for o... | google/cloud/translate/v3beta1/google-cloud-translation-v3beta1-java/proto-google-cloud-translation-v3beta1-java/src/main/java/com/google/cloud/translate/v3beta1/BatchDocumentOutputConfigOrBuilder.java | 0.874948 | 0.432902 | BatchDocumentOutputConfigOrBuilder.java | starcoder |
package swing_table;
/** Base class for a table or cell property value. Values are provided a table or cell for context. Eg, the value may compute its
* size taking into consideration the size of the table or the widget in the cell. Some values may be only valid for use with
* either call.
* @author <NAME> */
abstr... | src/main/java/swing_table/Value.java | 0.921895 | 0.655818 | Value.java | starcoder |
package us.ihmc.commonWalkingControlModules.capturePoint;
import us.ihmc.euclid.referenceFrame.*;
import us.ihmc.euclid.referenceFrame.interfaces.FixedFramePoint3DBasics;
import us.ihmc.euclid.referenceFrame.interfaces.FixedFrameVector2DBasics;
import us.ihmc.euclid.referenceFrame.interfaces.FramePoint2DReadOnly;
impo... | ihmc-common-walking-control-modules/src/main/java/us/ihmc/commonWalkingControlModules/capturePoint/ICPPlannerInterface.java | 0.876397 | 0.702428 | ICPPlannerInterface.java | starcoder |
package se.mickelus.tetra.blocks.scroll;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import com.mojang.math.Matrix3f;
import com.mojang.math.Matrix4f;
import com.mojang.math.Vector3f;
import com.mojang.math.Vector4f;
import net.minecraft.core.Direction;
import javax.an... | src/main/java/se/mickelus/tetra/blocks/scroll/QuadRenderer.java | 0.671686 | 0.413596 | QuadRenderer.java | starcoder |
package georegression.struct;
import java.io.Serializable;
/**
* <p>
* Any transform which has an unique inverse. T(u) = v and u = T<sup>-1</sup>(v).
* </p>
* <p>
* Functions are provided to determining the dimensionality of the transform, inverting the transform,
* and concating two transforms.
* </p>
* <p>
... | main/src/georegression/struct/InvertibleTransform.java | 0.932269 | 0.626753 | InvertibleTransform.java | starcoder |
package hackerrank.sorting;
import java.util.Scanner;
public class MergeSort {
private static long countInversions(int[] arr) {
int[] aux = arr.clone();
return mergesort(arr, 0, arr.length - 1, aux);
}
private static long mergesort(int[] arr, int leftStart, int rightEnd, int[] aux) {
... | src/main/java/hackerrank/sorting/MergeSort.java | 0.511473 | 0.424173 | MergeSort.java | starcoder |
package com.anji_ahni.integration;
import java.awt.Graphics2D;
import com.anji_ahni.util.XmlPersistable;
/**
* Although any object taking and returning double arrays can implement this, it is meant to be a simple neural net
* interface where the arrays are input and output activation patterns.
*
* @author <NAME... | 17-05-2017/neuralturingmachines-master/src/com/anji_ahni/integration/Activator.java | 0.889918 | 0.46721 | Activator.java | starcoder |
package org.assertj.core.internal;
import static java.lang.String.format;
import static java.util.Arrays.asList;
import static java.util.Arrays.stream;
import static java.util.stream.Collectors.toCollection;
import static java.util.stream.Collectors.toList;
import static org.assertj.core.error.ShouldBeEqual.shouldBeEq... | src/main/java/org/assertj/core/internal/Objects.java | 0.914309 | 0.710578 | Objects.java | starcoder |
package org.cryptimeleon.math.random;
import java.math.BigInteger;
public interface RandomGeneratorImpl {
/**
* Generates a uniformly random number between {@code 0} (inclusive) and {@code exclusiveUpperBound} (exclusive).
*/
default BigInteger getRandomNumber(BigInteger exclusiveUpperBound) {
... | src/main/java/org/cryptimeleon/math/random/RandomGeneratorImpl.java | 0.930907 | 0.432962 | RandomGeneratorImpl.java | starcoder |
package walkingkooka.spreadsheet.parser;
import walkingkooka.ToStringBuilder;
import walkingkooka.tree.expression.ExpressionEvaluationContext;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.Objects;
/**
* A {@link SpreadsheetParserTokenVisitor} that accepts ... | src/main/java/walkingkooka/spreadsheet/parser/SpreadsheetParserTokenVisitorLocalDateTime.java | 0.901952 | 0.413951 | SpreadsheetParserTokenVisitorLocalDateTime.java | starcoder |
package com.opengamma.financial.analytics.model.bond;
import java.util.Collections;
import java.util.Map;
import java.util.Set;
import org.threeten.bp.ZonedDateTime;
import com.google.common.collect.Sets;
import com.opengamma.OpenGammaRuntimeException;
import com.opengamma.analytics.financial.instrument.bond.BondFix... | projects/financial/src/main/java/com/opengamma/financial/analytics/model/bond/BondFromYieldFunction.java | 0.857395 | 0.493103 | BondFromYieldFunction.java | starcoder |
package engine;
import shapes.Sphere;
import utils.ImmutableVect3D;
import utils.Maths;
import utils.Vect3D;
/**
* Particle class, including movement vectors and size/weight properties.
* <p>
* <br />
* <br />
* <p>
* Includes some helper functions to set the mass and radius, and
* automatically sets the densi... | src/engine/Particle.java | 0.920079 | 0.548008 | Particle.java | starcoder |
package org.reactivetoolbox.core.lang;
import org.reactivetoolbox.core.lang.functional.Functions.FN1;
import org.reactivetoolbox.core.lang.functional.Functions.FN2;
import java.util.Objects;
import java.util.StringJoiner;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
/**
* General purpos... | core/src/main/java/org/reactivetoolbox/core/lang/Pair.java | 0.923717 | 0.405154 | Pair.java | starcoder |
package io.github.mmhelloworld.idrisjvm.runtime;
import java.math.BigInteger;
import java.util.Objects;
import static io.github.mmhelloworld.idrisjvm.runtime.IdrisObject.NO_ARG_CONSTRUCTOR_0;
import static io.github.mmhelloworld.idrisjvm.runtime.IdrisObject.NO_ARG_CONSTRUCTOR_1;
import static java.lang.String.format;... | idris-jvm-runtime/src/main/java/io/github/mmhelloworld/idrisjvm/runtime/Util.java | 0.782164 | 0.470858 | Util.java | starcoder |
* Using SineWave.java as a starting point, create
* a program that displays a rotating square on the
* screen. One slider should control the speed of
* rotation, and a second slider should control the
* size of the box.
***********************************************/
// package gui;
import javax.swing.*;
import javax.... | Learning/Thinking_in_Java_4th_Edition/Chapter_22/E23_RotatingSquare.java | 0.781038 | 0.427397 | E23_RotatingSquare.java | starcoder |
package org.apache.lucene.misc;
import org.apache.lucene.search.similarities.ClassicSimilarity;
/**
* <p>
* A similarity with a lengthNorm that provides for a "plateau" of
* equally good lengths, and tf helper functions.
* </p>
* <p>
* For lengthNorm, A min/max can be specified to define the
* plateau of lengt... | lucene/misc/src/java/org/apache/lucene/misc/SweetSpotSimilarity.java | 0.847684 | 0.441673 | SweetSpotSimilarity.java | starcoder |
package org.jbasics.math.strategies;
import org.jbasics.math.AlgorithmStrategy;
import java.math.BigDecimal;
import java.math.MathContext;
import java.util.concurrent.atomic.AtomicReferenceArray;
public class LogarithmAlgorithmStrategy implements AlgorithmStrategy<BigDecimal> {
private final AlgorithmStrategy<BigDe... | src/main/java/org/jbasics/math/strategies/LogarithmAlgorithmStrategy.java | 0.676834 | 0.442215 | LogarithmAlgorithmStrategy.java | starcoder |
package com.opengamma.financial.analytics.model.curve;
import static com.opengamma.engine.value.ValuePropertyNames.CURVE;
import static com.opengamma.engine.value.ValuePropertyNames.CURVE_SENSITIVITY_CURRENCY;
import static com.opengamma.engine.value.ValueRequirementNames.CURVE_INSTRUMENT_CONVERSION_HISTORICAL_TIME_SE... | projects/OG-Financial/src/main/java/com/opengamma/financial/analytics/model/curve/MultiCurveInterpolatedFunction.java | 0.902481 | 0.518546 | MultiCurveInterpolatedFunction.java | starcoder |
package pl.polidea.view;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.view.GestureDetector;
import android.view.MotionEvent;
... | Conventions/app/src/main/java/pl/polidea/view/ZoomView.java | 0.845496 | 0.41941 | ZoomView.java | starcoder |
package org.apache.poi.hssf.record;
import java.util.Map;
import java.util.function.Supplier;
import org.apache.poi.util.GenericRecordUtil;
import org.apache.poi.util.LittleEndianOutput;
/**
* Base class for all cell value records (implementors of {@link CellValueRecordInterface}).
* Subclasses are expected to man... | src/java/org/apache/poi/hssf/record/CellRecord.java | 0.910401 | 0.444806 | CellRecord.java | starcoder |
package org.basex.query.util.list;
import java.util.*;
import org.basex.data.*;
import org.basex.query.iter.*;
import org.basex.query.value.*;
import org.basex.query.value.node.*;
import org.basex.query.value.type.*;
import org.basex.util.*;
import org.basex.util.list.*;
/**
* Resizable-array implementation for nod... | basex-core/src/main/java/org/basex/query/util/list/ANodeList.java | 0.925188 | 0.407628 | ANodeList.java | starcoder |
package com.github.filosganga.geogson.model.positions;
import java.util.LinkedList;
import java.util.List;
/**
* It represent a collection of {@link AreaPositions} used to represent composed Are geometries like the
* {@link com.github.filosganga.geogson.model.MultiPolygon}.
*/
public class MultiDimensionalPosition... | core/src/main/java/com/github/filosganga/geogson/model/positions/MultiDimensionalPositions.java | 0.960231 | 0.648703 | MultiDimensionalPositions.java | starcoder |
package oasis.math;
import oasis.util.QuickHash;
/**
* 2D int vector
*
* @author <NAME>
*
*/
public class Vector2i {
public int x, y;
public Vector2i(int x, int y) {
this.x = x;
this.y = y;
}
public Vector2i(int[] a) {
this.x = a[0];
this.y = a[1]... | oasis-core/src/oasis/math/Vector2i.java | 0.782953 | 0.605128 | Vector2i.java | starcoder |
package burlap.behavior.singleagent.auxiliary.valuefunctionvis.common;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics2D;
import java.awt.geom.Rectangle2D;
import burlap.behavior.singleagent.auxiliary.valuefunctionvis.StateValuePainter;
import burlap.oomdp.core.Attribute;
import burlap.oomdp.cor... | Assignment4/BURLAP/src/burlap/behavior/singleagent/auxiliary/valuefunctionvis/common/StateValuePainter2D.java | 0.594316 | 0.491639 | StateValuePainter2D.java | starcoder |
package frc.team7170.lib.data;
import edu.wpi.first.wpilibj.Notifier;
import edu.wpi.first.wpilibj.Timer;
import frc.team7170.lib.data.property.RProperty;
import java.util.*;
import java.util.function.Consumer;
import java.util.stream.Collectors;
/**
* <p>
* A helper for scheduling periodically polling the value o... | src/main/java/frc/team7170/lib/data/PropertyPoller.java | 0.744563 | 0.481271 | PropertyPoller.java | starcoder |
package parallel;
import circuits.arithmetic.IntegerLib;
import flexsc.CompEnv;
public class GraphNodeBitonicSortLib<T> extends IntegerLib<T> {
T isAscending;
NodeComparator<T> comparator;
public GraphNodeBitonicSortLib(CompEnv<T> e, NodeComparator<T> comparator) {
super(e);
this.comparator = comparator;
}
... | src/parallel/GraphNodeBitonicSortLib.java | 0.517327 | 0.40869 | GraphNodeBitonicSortLib.java | starcoder |
package burlap.oomdp.singleagent.pomdp;
import burlap.oomdp.auxiliary.StateGenerator;
import burlap.oomdp.core.Domain;
import burlap.oomdp.core.TerminalFunction;
import burlap.oomdp.core.states.MutableState;
import burlap.oomdp.core.states.State;
import burlap.oomdp.singleagent.GroundedAction;
import burlap.oomdp.sing... | Assignment4/BURLAP/src/burlap/oomdp/singleagent/pomdp/SimulatedPOEnvironment.java | 0.832305 | 0.414247 | SimulatedPOEnvironment.java | starcoder |
package marc.henrard.book.algorithmicdifferentiation.example;
import marc.henrard.book.algorithmicdifferentiation.mathad.MathAad;
import marc.henrard.book.algorithmicdifferentiation.mathad.MathSad;
import marc.henrard.book.algorithmicdifferentiation.tape.TapeAad;
import marc.henrard.book.algorithmicdifferentiation.typ... | src/main/java/marc/henrard/book/algorithmicdifferentiation/example/AdStarter.java | 0.859044 | 0.557665 | AdStarter.java | starcoder |
package de.uni_mannheim.informatik.dws.melt.matching_jena_matchers.util.addnegatives;
import com.googlecode.cqengine.query.QueryFactory;
import de.uni_mannheim.informatik.dws.melt.matching_base.AddNegatives;
import de.uni_mannheim.informatik.dws.melt.matching_jena.MatcherYAAAJena;
import de.uni_mannheim.informatik.dws... | matching-jena-matchers/src/main/java/de/uni_mannheim/informatik/dws/melt/matching_jena_matchers/util/addnegatives/AddNegativesViaAlignment.java | 0.875028 | 0.460653 | AddNegativesViaAlignment.java | starcoder |
package datastructures;
import java.util.Comparator;
/**
* An implementation of a sorted map using a red-black tree.
*
* @author <NAME>
* @author <NAME>
* @author <NAME>
*/
public class RBTreeMap<K,V> extends TreeMap<K,V> {
/** Constructs an empty map using the natural ordering of keys. */
public RBTreeMap... | advancedDS/src/datastructures/RBTreeMap.java | 0.874332 | 0.42054 | RBTreeMap.java | starcoder |
import org.junit.jupiter.api.Test;
public class MyUnitTest {
@Test
public void testMap() {
PersistentMap<Integer, Integer> emptyMap = new PersistentMap<>();
PersistentMap<Integer, Integer> map_1_10 = emptyMap.insert(1, 10);
PersistentMap<Integer, Integer> map_1_10_2_20 = map_1_... | src/MyUnitTest.java | 0.8321 | 0.636847 | MyUnitTest.java | starcoder |
package ch.hslu.oop.SW07.objectsEqualsCompare.temperature;
import java.util.Objects;
public class Temperature implements Comparable<Temperature> {
private double currentTemperatureInCelsius;
/**
* Creates a new Temperature with default value 20
*/
public Temperature() {
this.currentTemperatureInCelsi... | src/main/java/ch/hslu/oop/SW07/objectsEqualsCompare/temperature/Temperature.java | 0.946831 | 0.533215 | Temperature.java | starcoder |
package invmgr.Models;
import invmgr.AbstractClasses.Part;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
/** Represents an collection of the application's parts.
* @author <NAME>
* @version 1.0
* @since 1.0
*/
public class Inventory {
private static ObservableList<Part> a... | src/invmgr/Models/Inventory.java | 0.863363 | 0.41834 | Inventory.java | starcoder |
package org.spongepowered.api.text.selector;
import java.util.Set;
/**
* Represents a holder of {@link ArgumentHolder}s. This interface is extended by
* both Vector3 and Limit. It is also extended by {@link ArgumentType}, as any
* {@link ArgumentType} "holds" itself. This also allows for Limit to have more
* stri... | src/main/java/org/spongepowered/api/text/selector/ArgumentHolder.java | 0.953827 | 0.554893 | ArgumentHolder.java | starcoder |
package net.runelite.api.model;
import java.util.List;
import net.runelite.api.Point;
import net.runelite.api.geometry.SimplePolygon;
/**
* Provides utility methods for computing the convex hull of a list of
* <em>n</em> points.
* <p>
* The implementation uses the Jarvis march algorithm and runs in O(nh)
* time ... | runelite-api/src/main/java/net/runelite/api/model/Jarvis.java | 0.785925 | 0.466116 | Jarvis.java | starcoder |
package org.apache.juneau.dto.html5;
import static org.apache.juneau.internal.StringUtils.*;
/**
* Various useful static methods for creating HTML elements.
*
* <h5 class='section'>See Also:</h5>
* <ul class='doctree'>
* <li class='link'>{@doc juneau-dto.HTML5}
* </ul>
*/
public class HtmlBuilder {
/**
* ... | juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/HtmlBuilder.java | 0.925238 | 0.645525 | HtmlBuilder.java | starcoder |
package me.lucko.helper.utils;
/**
* Utility for quickly performing Maths calculations.
*/
public final class Maths {
private static final int SIN_BITS, SIN_MASK, SIN_COUNT;
private static final float radFull, radToIndex;
private static final float degFull, degToIndex;
private static final float DIS... | helper/src/main/java/me/lucko/helper/utils/Maths.java | 0.881602 | 0.412826 | Maths.java | starcoder |
package io.github.bhowell2.apilib;
import io.github.bhowell2.apilib.checks.CollectionIndexCheck;
import io.github.bhowell2.apilib.checks.Check;
import io.github.bhowell2.apilib.errors.ApiErrorType;
import io.github.bhowell2.apilib.errors.ApiParamError;
import java.util.ArrayList;
import java.util.Arrays;
import java.... | src/main/java/io/github/bhowell2/apilib/ApiCollectionParam.java | 0.789477 | 0.519217 | ApiCollectionParam.java | starcoder |
package btl.aplication;
import java.util.ArrayList;
public class BigInteger {
private DigitList digits;
private int sign;
public BigInteger() {
this.digits = null;
this.sign = 1;
}
public BigInteger(DigitList L) {
this.digits = L;
this.sign = 1;
}
public ... | btl/src/main/java/btl/aplication/BigInteger.java | 0.559771 | 0.662353 | BigInteger.java | starcoder |
package org.nodomain.volkerk.SimpleTIFFlib;
import org.junit.Test;
import static org.junit.Assert.*;
/**
*
* @author volker
*/
public class FlexByteArrayTest {
protected FlexByteArray getTestArray()
{
byte[] result = new byte[10]; // {0x01, 0x02, 0x03, 0x04, 0xFF, 0xFE, 0xFD, 0xFC, 0x00};
... | test/org/nodomain/volkerk/SimpleTIFFlib/FlexByteArrayTest.java | 0.739611 | 0.649353 | FlexByteArrayTest.java | starcoder |
package org.apache.logging.log4j.core.lookup;
import org.apache.logging.log4j.core.LogEvent;
/**
* Lookup a String key to a String value.
* <p>
* This class represents the simplest form of a string to string map.
* It has a benefit over a map in that it can create the result on
* demand based on the key.
* <p>
... | log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/StrLookup.java | 0.896041 | 0.495484 | StrLookup.java | starcoder |
package de.mhus.lib.core.crypt;
import java.math.BigInteger;
import de.mhus.lib.core.MSystem;
public class AsyncKey {
private BigInteger modulus;
private BigInteger publicExponent;
private BigInteger privateExponent;
private BigInteger prime1;
private BigInteger prime2;
private BigInteger exp... | src/main/java/de/mhus/lib/core/crypt/AsyncKey.java | 0.860061 | 0.495911 | AsyncKey.java | starcoder |
package junit.framework;
import java.lang.reflect.*;
/**
* A test case defines the fixture to run multiple tests. To define a test case<br>
* 1) implement a subclass of TestCase<br>
* 2) define instance variables that store the state of the fixture<br>
* 3) initialize the fixture state by overriding <code>setUp</... | Algorithms/src/main/java/junit/framework/TestCase.java | 0.835651 | 0.503906 | TestCase.java | starcoder |
package org.qcri.rheem.core.util;
import org.apache.commons.lang3.SerializationException;
import org.json.JSONArray;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
/**
* Utility to deal with {@link JsonSerializable}s.
*/
public class JsonSerializables {
... | rheem-core/src/main/java/org/qcri/rheem/core/util/JsonSerializables.java | 0.953503 | 0.412471 | JsonSerializables.java | starcoder |
package it.isislab.dmason.experimentals.sim.field.support.loadbalancing;
import it.isislab.dmason.sim.field.DistributedField2D;
import java.util.ArrayList;
/**
* Interface for all class of load balancing
*
*
*/
public interface LoadBalancingInterface {
/**
* Provide to generate the Cells
* @param x is t... | src/main/java/it/isislab/dmason/experimentals/sim/field/support/loadbalancing/LoadBalancingInterface.java | 0.812644 | 0.410106 | LoadBalancingInterface.java | starcoder |
import java.awt.*;
/**
* A canvas with a buffer image. All drawing on the canvas is reflected in the
* buffer image so as to be able to respond to re-paint events.
*
* @author <NAME>
*/
public class BufferedCanvas extends Canvas
{
/// Dimension of the canvas
protected int width, height;
/// Image buf... | hudson_gui/BufferedCanvas.java | 0.700075 | 0.421611 | BufferedCanvas.java | starcoder |
package java.io;
/**
* This abstract class forms the base of the hierarchy of classes that read
* input as a stream of bytes. It provides a common set of methods for
* reading bytes from streams. Subclasses implement and extend these
* methods to read bytes from a particular input source such as a file
* o... | fivm/fijicore/src/java/io/InputStream.java | 0.84891 | 0.45417 | InputStream.java | starcoder |
package java.io;
import java.util.Arrays;
/**
* A specialized {@link Writer} that writes characters to a {@code StringBuffer}
* in a sequential manner, appending them in the process. The result can later
* be queried using the {@link #StringWriter(int)} or {@link #toString()}
* methods.
*
* @see StringReader
*... | Core/rt/src/main/java/java/io/StringWriter.java | 0.953966 | 0.470554 | StringWriter.java | starcoder |
package ch.epfl.cs107.play.game.enigme.area;
import ch.epfl.cs107.play.game.areagame.actor.Orientation;
import ch.epfl.cs107.play.game.enigme.actor.*;
import ch.epfl.cs107.play.io.FileSystem;
import ch.epfl.cs107.play.math.Circle;
import ch.epfl.cs107.play.math.DiscreteCoordinates;
import ch.epfl.cs107.play.math.Vecto... | java/ch/epfl/cs107/play/game/enigme/area/Level3.java | 0.766556 | 0.406037 | Level3.java | starcoder |
package com.hazelcast.internal.util.hashslot.impl;
import com.hazelcast.internal.util.QuickMath;
/**
* Utility functions related to data structure capacity calculation.
*/
public final class CapacityUtil {
/** Maximum length of a Java array that is a power of two. */
@SuppressWarnings("checkstyle:magicnumb... | hazelcast/src/main/java/com/hazelcast/internal/util/hashslot/impl/CapacityUtil.java | 0.884383 | 0.420064 | CapacityUtil.java | starcoder |
package org.spongepowered.api.effect.particle;
import org.spongepowered.api.entity.living.player.Player;
import org.spongepowered.api.util.generator.dummy.DummyObjectProvider;
/**
* An enumeration of all possible {@link ParticleType}s in vanilla minecraft.
*/
public final class ParticleTypes {
// SORTFIELDS:ON... | src/main/java/org/spongepowered/api/effect/particle/ParticleTypes.java | 0.795499 | 0.58264 | ParticleTypes.java | starcoder |
package com.ponysdk.core.util;
import java.util.Collection;
import java.util.Iterator;
import java.util.Objects;
import java.util.Set;
import java.util.Spliterator;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.stream.Stream;
/**
* A poo... | ponysdk/src/main/java/com/ponysdk/core/util/SetPool.java | 0.946708 | 0.642489 | SetPool.java | starcoder |
package data_structure;
import happy.coding.io.Strings;
import happy.coding.math.Randoms;
import java.io.Serializable;
import java.util.Arrays;
/**
* Data Structure: dense matrix <br>
*
* A big reason that we do not adopt original DenseMatrix from M4J libraray is
* because the latter using one-dim... | src/data_structure/DenseMatrix.java | 0.799521 | 0.4112 | DenseMatrix.java | starcoder |
package nodes;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
// 8 3 13 1 7 10 14 6 4
class Node4 {
int data;
Node4 left, right;
Node4(int data) {
this.data = data;
left = right = null;
}
}
public class DistanceBetween2Nodes {
Node4 root;
static int ancestor = 0;
static int ... | Tree_Practice/src/nodes/DistanceBetween2Nodes.java | 0.58522 | 0.596962 | DistanceBetween2Nodes.java | starcoder |
import java.lang.Comparable;
public class LinkedBST<T extends Comparable<T>> {
private BSTNode<T> root;
public LinkedBST() {
root = null;
}
public void insert(T value) {
if (root == null)
root = new BSTNode<T>(value, null);
else
root.insertValue(value)... | ExamReview2016/src/LinkedBST.java | 0.709623 | 0.449332 | LinkedBST.java | starcoder |
package org.lwjgl.nanovg;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.Checks.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* <h3>Layout</h3>
*
* <pre><code>
* struct NSVGgradient {
* float xform[6];
* char spread;
* float fx;
* ... | modules/lwjgl/nanovg/src/generated/java/org/lwjgl/nanovg/NSVGGradient.java | 0.875175 | 0.406774 | NSVGGradient.java | starcoder |
package com.google.mediapipe.glutil;
import android.graphics.SurfaceTexture;
import android.opengl.GLES11Ext;
import android.opengl.GLES20;
import android.view.Surface;
import java.nio.FloatBuffer;
import java.util.HashMap;
import java.util.Map;
/**
* Textures from {@link SurfaceTexture} are only supposed to be bou... | mediapipe/java/com/google/mediapipe/glutil/ExternalTextureRenderer.java | 0.872034 | 0.545044 | ExternalTextureRenderer.java | starcoder |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.