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
public class Utilitario { //Atributos public static final int comprimentoChamadaTexto = 144; // Variável estática final com a quantidade de caracteres limite de cada bloco de chamada de texto public static final int vencimentoRecarga = 90; public static float custoChamadaVoz; public static float cus...
Utilitario.java
0.533641
0.401746
Utilitario.java
starcoder
package functionalj.function; /** * This class offer a way to make it easy to debug lambda by adding name to them. * * @author NawaMan **/ // https://stackoverflow.com/questions/42876840/namingtostring-lambda-expressions-for-debugging-purpose/42876841#42876841 // https://stackoverflow.com/questions/23704355/creat...
functionalj-core/src/main/java/functionalj/function/Named.java
0.805861
0.400134
Named.java
starcoder
package org.qxn; import org.qxn.gates.Gate; import org.qxn.linalg.Complex; import org.qxn.linalg.ComplexMatrix; import org.qxn.linalg.ComplexMatrixMath; import java.util.ArrayList; import java.util.List; import java.util.Random; /** * Constructs a quantum circuit using the Quantum Abstract Machine (QAM) model */ p...
src/main/java/org/qxn/QuantumMachine.java
0.950157
0.651847
QuantumMachine.java
starcoder
package graph.node; import graph.node.operation.Operations; import math.Tensor; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /** * A <code>Node</code> represents a given operation or value in the computational graph. A * <code>Node</code> must have a unique ide...
src/main/java/graph/node/Node.java
0.933476
0.633297
Node.java
starcoder
package com.telenav.kivakit.data.compression; import com.telenav.kivakit.data.compression.codecs.huffman.FastHuffmanDecoder; import com.telenav.kivakit.data.compression.codecs.huffman.HuffmanCodec; import com.telenav.kivakit.primitive.collections.list.ByteList; import java.util.Iterator; /** * Interface to a compr...
kivakit-data/compression/src/main/java/com/telenav/kivakit/data/compression/Codec.java
0.898316
0.403802
Codec.java
starcoder
package io.github.mybatisx.core.criteria.query; /** * 聚合函数查询列接口(支持lambda语法) * @param <T> 实体类型 * @param <C> 子类型 * @author wvkity * @created 2021-07-08 * @since 1.0.0 */ public interface CommonFunctionSelect<T, C extends CommonFunctionSelect<T, C>> { // region Count function methods /** * {@code Co...
mybatisx-core/src/main/java/io/github/mybatisx/core/criteria/query/CommonFunctionSelect.java
0.699254
0.456713
CommonFunctionSelect.java
starcoder
package org.tms.tds; import static org.hamcrest.core.Is.is; import static org.hamcrest.core.IsNull.nullValue; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertThat; import org.junit.AfterClass; import org.junit.Test; import org.tms.BaseTest;...
test/src/org/tms/tds/TagTest.java
0.665845
0.499329
TagTest.java
starcoder
import java.util.LinkedList; import java.util.Queue; import java.util.Stack; /* 430. Flatten a Multilevel Doubly Linked List Medium https://leetcode.com/problems/flatten-a-multilevel-doubly-linked-list/ Runtime: 0 ms, faster than 100.00% of Java online submissions for Flatten a Multilevel Doubly Linked List. Memory ...
linkedlists/FlattenAMultilevelDoublyLinkedList.java
0.821474
0.412175
FlattenAMultilevelDoublyLinkedList.java
starcoder
package spherepong.systems; import java.awt.Rectangle; import org.joml.Vector3f; import com.artemis.Aspect; import com.artemis.Entity; import com.artemis.EntitySystem; import com.artemis.utils.Bag; import spherepong.components.BoundingBox; import spherepong.components.Position; import spherepong.components.Velocity...
src/spherepong/systems/CollisionSystem.java
0.672977
0.406361
CollisionSystem.java
starcoder
package com.opengamma.financial.analytics.model.riskfactor.option; import org.apache.commons.lang.NotImplementedException; import com.opengamma.core.historicaltimeseries.HistoricalTimeSeries; import com.opengamma.core.historicaltimeseries.HistoricalTimeSeriesFields; import com.opengamma.core.historicaltimeseries.Hist...
projects/OG-Financial/src/com/opengamma/financial/analytics/model/riskfactor/option/UnderlyingTypeToHistoricalTimeSeries.java
0.770292
0.459137
UnderlyingTypeToHistoricalTimeSeries.java
starcoder
package uk.ac.sussex.gdsc.smlm.model; import java.util.ArrayList; import java.util.Arrays; import java.util.List; /** * Contains a model for a blinking fluorophore. * * <p>Based on the work of Coltharp et al (2012) Accurate Construction of photoactivated * localization microscopy images for quantitative measureme...
src/main/java/uk/ac/sussex/gdsc/smlm/model/FluorophoreSequenceModel.java
0.915573
0.581422
FluorophoreSequenceModel.java
starcoder
package graph.algorithms; import static org.junit.Assert.*; import java.util.LinkedHashSet; import java.util.Map; import java.util.Set; import graph.components.BasicGraph; import graph.components.BasicNode; import graph.components.BasicWeightedEdge; import graph.elements.Graph; import graph.elements.Node; import gra...
test/graph/algorithms/ShortestPathToNodeTest.java
0.881526
0.582699
ShortestPathToNodeTest.java
starcoder
package heuristics; import java.util.Collections; import java.util.HashMap; import java.util.Map; /** * An abstraction representation of a heuristic * @author <NAME> {@link https://mirkoalicastro.com} */ public abstract class Heuristic { private int iterations, iterationsWithNoIncrement; privat...
src/heuristics/Heuristic.java
0.918594
0.437703
Heuristic.java
starcoder
package com.evanstella.jnp.math; import com.evanstella.jnp.core.Complex; import com.evanstella.jnp.core.IllegalDimensionException; import com.evanstella.jnp.core.NDArray; import com.evanstella.jnp.core.Numeric; /****************************************************************************** * Vector encapsulates all ...
src/com/evanstella/jnp/math/Vector.java
0.837088
0.707335
Vector.java
starcoder
package oap.util; import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.Collection; import java.util.Comparator; import java.util.Enumeration; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Objects;...
oap-stdlib/src/main/java/oap/util/Stream.java
0.843412
0.44083
Stream.java
starcoder
package io.github.satr.training.algorithms; import io.github.satr.training.ArrayHelper; import java.util.Stack; public class SortAlgorithms { //------------------------------------------------------------------------------------ public static void shellSort(int[] array) { int length = array.length; ...
training-utils/src/io/github/satr/training/algorithms/SortAlgorithms.java
0.693161
0.523603
SortAlgorithms.java
starcoder
package fwcd.fructose; import java.io.Serializable; import java.util.Collections; import java.util.Iterator; import java.util.NoSuchElementException; import java.util.Objects; import java.util.OptionalInt; import java.util.function.IntConsumer; import java.util.function.IntFunction; import java.util.function.IntPredic...
src/main/java/fwcd/fructose/OptionInt.java
0.923446
0.427456
OptionInt.java
starcoder
package org.im97mori.rbt.ble.characteristic.cs; import android.bluetooth.BluetoothGattCharacteristic; import android.os.Parcel; import org.junit.Test; import static org.im97mori.ble.BLEConstants.BASE_UUID; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import static or...
ble-characteristic/characteristic-cs/src/androidTest/java/org/im97mori/rbt/ble/characteristic/cs/InstallationOffsetTest.java
0.804021
0.430686
InstallationOffsetTest.java
starcoder
package org.mockitousage.basicapi; import org.junit.Before; import org.junit.Test; import org.mockito.Mock; import org.mockito.Spy; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.*; import static org.mockito.MockitoAnnotations.initMoc...
test/org/mockitousage/basicapi/MockingDetailsTest.java
0.728072
0.41834
MockingDetailsTest.java
starcoder
package dev; public class NotesShex { // Grammar. Check file for ToDo and other notes. // Test Suite // == Initial Jena commit // [x] Unlink from SHACL :: PLib // [x] Reporting: printing // [x] <CODE> needs work. // [?] Cardinality parsing and string tests // [x] Check for // [shex] ...
src/main/java/dev/NotesShex.java
0.547948
0.423339
NotesShex.java
starcoder
import edu.princeton.cs.algs4.Queue; /** * The {@code SequentialSearchST} class represents an (unordered) * symbol table of generic key-value pairs. * It supports the usual <em>put</em>, <em>get</em>, <em>contains</em>, * <em>delete</em>, <em>size</em>, and <em>is-empty</em> methods. * It also provides a <em...
LAB3/SequentialSearchST.java
0.894326
0.597432
SequentialSearchST.java
starcoder
package boolfun; /** * Class which represents a generic Boolean function of n variables, along with * its representations (truth table, ANF), spectra (Walsh, autocorrelation) and * cryptographic properties (balancedness, algebraic degree, nonlinearity, * resiliency, propagation criterion, number of nonzero linear ...
src/boolfun/BooleanFunction.java
0.909325
0.472866
BooleanFunction.java
starcoder
package experiments; import core.algo.vertical.AbstractAlgorithm; import core.algo.vertical.AbstractPartitionsAlgorithm; import core.algo.vertical.AutoPart; import core.algo.vertical.DreamPartitioner; import core.utils.ArrayUtils; import gnu.trove.map.hash.TIntObjectHashMap; import gnu.trove.set.hash.TIntHashSet; imp...
src/experiments/AlgorithmResults.java
0.758511
0.425665
AlgorithmResults.java
starcoder
package com.rijia.workPlatform.util; import java.math.BigDecimal; import java.text.DecimalFormat; import java.text.ParseException; import java.util.HashMap; import java.util.Map; import org.apache.commons.lang3.StringUtils; public class NumberUtils { // 默认除法运算精度 private static final int DEF_DIV_SCALE = 10; privat...
source/workPlatform/src/main/java/com/rijia/workPlatform/util/NumberUtils.java
0.628635
0.461199
NumberUtils.java
starcoder
package org.kuali.kra.budget.nonpersonnel; import org.kuali.coeus.sys.api.model.ScaleTwoDecimal; import org.kuali.kra.budget.core.BudgetAssociate; import org.kuali.kra.budget.rates.RateClass; import java.sql.Date; public abstract class AbstractBudgetRateAndBase extends BudgetAssociate { private static final lo...
coeus-code/src/main/java/org/kuali/kra/budget/nonpersonnel/AbstractBudgetRateAndBase.java
0.781414
0.442817
AbstractBudgetRateAndBase.java
starcoder
package no.uib.cipr.matrix.sparse; import no.uib.cipr.matrix.Vector; import no.uib.cipr.matrix.Vector.Norm; /** * Partial implementation of an iteration reporter */ public abstract class AbstractIterationMonitor implements IterationMonitor { /** * Iteration number */ protected int iter; /** ...
rebro/src/java/no/uib/cipr/matrix/sparse/AbstractIterationMonitor.java
0.822118
0.461077
AbstractIterationMonitor.java
starcoder
package de.tinloaf.intervaltree; import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; import java.util.List; import java.util.Set; /** * An Interval Tree implementation based on a Red-Black-Tree. Supports insertion, deletion, lookups and multiple entries * per interval. * * Please n...
src/de/tinloaf/intervaltree/IntervalTree.java
0.865594
0.555496
IntervalTree.java
starcoder
package Service; import Model.LinearEquation; import java.util.ArrayList; import java.util.List; public class Solution{ public void solverLinearEquation(List<LinearEquation> problem) { if(problem.size()==1 ){ if(problem.get(0).coefficient.size() == 1){ System.out.println((pro...
src/Service/Solution.java
0.816626
0.434701
Solution.java
starcoder
class StatList { /** * The Acceleration stat * first value being how fast the car can move from rest (not moving). * Second and third value meaning how much speed it gains while the car is moving * @author <NAME> */ public static final float[][] acelf = { { ...
StatList.java
0.822153
0.59411
StatList.java
starcoder
package androidx.media3.transformer; import static androidx.media3.common.util.Assertions.checkNotNull; import static androidx.media3.common.util.Assertions.checkState; import static androidx.media3.common.util.Assertions.checkStateNotNull; import static com.google.common.truth.Truth.assertThat; import static com.goog...
libraries/transformer/src/androidTest/java/androidx/media3/transformer/SsimHelper.java
0.931774
0.510985
SsimHelper.java
starcoder
import edu.princeton.cs.algs4.StdDraw; import edu.princeton.cs.algs4.StdRandom; import java.util.TreeSet; public class Quick3wayBars { private static int rows; private static int row = 0; private static final int VERTICAL = 70; public static void sort(double[] a) { // StdRandom.shuffle(a); ...
Courses + Books/Algorithms/Book/Part 1/02 - Sorting/02_3 - Quicksort/Reading Part - Exercises/Quick3wayBars.java
0.683736
0.410284
Quick3wayBars.java
starcoder
package com.apw.speedcon; import java.util.List; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.Map; public class SizeConstants { /** * This is a file of size constants, so that we can accurately tell our distance from an object by knowing its width * once we h...
src/main/java/com/apw/speedcon/SizeConstants.java
0.570571
0.529142
SizeConstants.java
starcoder
package Chapter8; import static com.thinkinjava.util.Print.*; enum Note { MIDDLE_C, C_SHARP, B_FLAT, } class Instrument { public void Play(Note n) { println("Instrument.paly(" + n + ")"); } public String What() { return "Instrument"; } public void adjust() { println...
HelloJava/src/Chapter8/Music.java
0.571049
0.440229
Music.java
starcoder
package com.kirekov.juu.collection.immutable; import com.kirekov.juu.lambda.TriFunction; import java.util.Map; import java.util.Objects; import java.util.function.BiConsumer; /** * Defines an immutable map. Unlike native {@link Map} this interface does not have any methods that * can mutate its content. So it can b...
src/main/java/com/kirekov/juu/collection/immutable/ImmutableMap.java
0.960305
0.438605
ImmutableMap.java
starcoder
package com.mindbodyonline.ironhide.Infrastructure; import android.database.Cursor; import android.support.test.espresso.matcher.CursorMatchers; import org.hamcrest.Matcher; /** * Cursors provides cursor assertion chaining. */ public class Cursors { private final Cursor check; public Cursors(Cursor toChe...
lib/src/main/java/com/mindbodyonline/ironhide/Infrastructure/Cursors.java
0.932029
0.690129
Cursors.java
starcoder
package JavaBitcoin; import java.math.BigInteger; /** * A StoredBlock represents data that is stored in the chain database. This * includes the Block as defined by the Bitcoin protocol. */ public class StoredBlock { /** The work represented by the block chain up to and including this block */ private Big...
src/JavaBitcoin/StoredBlock.java
0.92179
0.501709
StoredBlock.java
starcoder
package io.improbable.keanu; import io.improbable.keanu.distributions.continuous.Gamma; import io.improbable.keanu.distributions.continuous.Laplace; import io.improbable.keanu.distributions.discrete.Poisson; import io.improbable.keanu.tensor.dbl.DoubleTensor; import io.improbable.keanu.tensor.intgr.IntegerTensor; impo...
keanu-project/src/main/java/io/improbable/keanu/KeanuRandom.java
0.904707
0.59658
KeanuRandom.java
starcoder
package com.kbolino.libraries.bytestring; import java.nio.BufferOverflowException; import java.nio.ByteBuffer; import java.nio.ReadOnlyBufferException; /** * An immutable string of bytes. * Analogous to {@link String} but for {@code byte}s instead of {@code char}s. * <p>By design, there are no concatenation method...
src/main/java/com/kbolino/libraries/bytestring/ByteString.java
0.928092
0.490297
ByteString.java
starcoder
package be.yildizgames.common.geometry; /** * Represent a 2D rectangle and contains the 4 extremities data. * * @author <NAME> */ public final class Rectangle { /** * Left X value. */ private int left; /** * Up Y value. */ private int top; /** * Right X value. ...
src/main/java/be/yildizgames/common/geometry/Rectangle.java
0.921909
0.463141
Rectangle.java
starcoder
package seedu.expensetracker.model.expense; import static seedu.expensetracker.commons.util.AppUtil.checkArgument; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; //@@author jonathantjm /** * Represents the date the Expense was added into the Expense tracker. * Guarantees: immutable; is ...
src/main/java/seedu/expensetracker/model/expense/Date.java
0.911003
0.491151
Date.java
starcoder
package groovy.lang; import java.util.Collection; import java.util.Map; import java.util.Set; /** * A wrapper for Map which allows a default value to be specified using a closure. * Normally not instantiated directly but used via the DGM <code>withDefault</code> method. * * @since 1.7.1 */ public final class Map...
src/main/java/groovy/lang/MapWithDefault.java
0.954669
0.411288
MapWithDefault.java
starcoder
package com.liyafeng.algorithm.leetcode.array; /** * Created by liyafeng on 2018/3/2. */ public class LeetCode_4_MedianOfTwoSortedArrays_Hard { /** * 两个排序数组的中位数 * There are two sorted arrays nums1 and nums2 of size m and n respectively. * <p> * Find the median of the two sorted arrays. The ...
Algorithm/src/main/java/com/liyafeng/algorithm/leetcode/array/LeetCode_4_MedianOfTwoSortedArrays_Hard.java
0.747708
0.533641
LeetCode_4_MedianOfTwoSortedArrays_Hard.java
starcoder
package mktgbi.algorithm.util; import mktgbi.dataio.*; import mktgbi.util.GaMath; import java.util.*; /** * @author yingliu * */ public class Cluster { private ArrayList<Integer> m_members = null; /** * copy constructor * @param cluster */ public Cluster(Cluster cluster) { int numMembers = cluste...
src/mktgbi/algorithm/util/Cluster.java
0.759671
0.536374
Cluster.java
starcoder
package ucar.geoapi; import java.util.Map; import java.util.List; import java.util.Arrays; import java.util.Collection; import java.util.LinkedHashMap; import ucar.nc2.constants.CF; import ucar.unidata.util.Parameter; import ucar.unidata.geoloc.Projection; import ucar.unidata.geoloc.projection.*; import org.opengis....
src/main/java/ucar/geoapi/ProjectionProvider.java
0.86959
0.414366
ProjectionProvider.java
starcoder
package org.deeplearning4j.clustering.vptree; import org.nd4j.linalg.api.ndarray.DimensionSlice; import org.nd4j.linalg.api.ndarray.INDArray; import org.nd4j.linalg.api.ndarray.SliceOp; import org.nd4j.linalg.distancefunction.DistanceFunction; import org.nd4j.linalg.distancefunction.EuclideanDistance; import java.uti...
deeplearning4j-core/src/main/java/org/deeplearning4j/clustering/vptree/VpTreePointINDArray.java
0.871625
0.540075
VpTreePointINDArray.java
starcoder
package com.github.forax.tomahawk.vec; import java.io.UncheckedIOException; /** * Base interface of all {0code Vec}, a column of values or a list/structure of column of values * for the most complex implementation. * * There are 3 kinds of Vec * <ul> * <li>Primitive Vec, {@link U8Vec}, {@link U16Vec}, {@link ...
src/main/java/com/github/forax/tomahawk/vec/Vec.java
0.951323
0.604983
Vec.java
starcoder
package hywt.math; import hywt.math.tensor.Vector3D; import java.util.Objects; public class Color3 { public int r; public int g; public int b; public Color3(int r, int g, int b) { this.r = r; this.g = g; this.b = b; } public Color3(double rp, double gp, double bp) { ...
src/main/java/hywt/math/Color3.java
0.848125
0.416085
Color3.java
starcoder
package xyz.studiomango.textra.api.stream; import java.io.IOException; import java.io.OutputStream; import java.nio.charset.StandardCharsets; /** * Writable stream. This stream won't throw {@link IOException}, unlike standard * {@link OutputStream} * @author nahkd123 * */ public interface WritableStream { /**...
Textra/src/main/java/xyz/studiomango/textra/api/stream/WritableStream.java
0.773473
0.4081
WritableStream.java
starcoder
package de.marhali.json5; import java.math.BigInteger; import java.util.Objects; /** * A class representing a hexadecimal json5 value. Hex values will be stored as {@link BigInteger} internally. * * @author <NAME> */ public final class Json5Hexadecimal extends Json5Primitive { /** * Converts the provide...
src/main/java/de/marhali/json5/Json5Hexadecimal.java
0.950169
0.425546
Json5Hexadecimal.java
starcoder
package dev.area51.util.counter; import dev.area51.util.DaemonThreadFactory; import dev.area51.xsd.amqrabbitbridge.v1.RateLogger; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Consumer; import java.util.lo...
src/main/java/dev/area51/util/counter/RateMonitor.java
0.882403
0.408749
RateMonitor.java
starcoder
package io.inverno.mod.base.converter; import java.lang.reflect.Type; import java.util.List; import java.util.Set; /** * <p> * A decoder that can decode an object to a collection of objects. * </p> * * @author <a href="mailto:<EMAIL>"><NAME></a> * @since 1.0 * * @see Decoder * * @param <From> the encoded ...
inverno-base/src/main/java/io/inverno/mod/base/converter/SplittableDecoder.java
0.887461
0.410077
SplittableDecoder.java
starcoder
class Solution { int[][] dirs = {{0, 1}, {1, 0}, {0, -1}, {-1, 0}}; public int cutOffTree(List<List<Integer>> forest) { if (forest == null || forest.size() == 0) { return -1; } int m = forest.size(), n = forest.get(0).size(); int ans = 0; List<int[]> heights =...
BFS/levelFocus/675.CutOffTreesforGolfEvent/cutOffTreesforGolfEvent.java
0.875946
0.435601
cutOffTreesforGolfEvent.java
starcoder
package de.scravy.bedrock; import lombok.Getter; import javax.annotation.Nullable; import java.util.HashMap; import java.util.Map; import java.util.TreeSet; import java.util.function.IntConsumer; /** * A simple directed graph is defined by it's vertices and edges, where the vertices * are simple indices starting f...
src/main/java/de/scravy/bedrock/SimpleDirectedGraph.java
0.844505
0.444203
SimpleDirectedGraph.java
starcoder
package qub; public interface ManualClockTests { static void test(TestRunner runner) { runner.testGroup(ManualClock.class, () -> { runner.testGroup("create(DateTime,AsyncRunner)", () -> { runner.test("with null mainAsyncRunner", (Test test) -> ...
tests/qub/ManualClockTests.java
0.882529
0.575946
ManualClockTests.java
starcoder
package org.dalesbred.result; import org.dalesbred.internal.utils.TypeUtils; import org.jetbrains.annotations.NotNull; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import static java.util.Collections.unmodifiableList; import static java.util.Objects.req...
dalesbred/src/main/java/org/dalesbred/result/ResultTable.java
0.923799
0.538983
ResultTable.java
starcoder
package org.kakara.core.common.world; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.util.Objects; import java.util.Optional; public class Location { @Nullable private World world; private double x; private double y; private double z; private ...
common/src/main/java/org/kakara/core/common/world/Location.java
0.914682
0.688727
Location.java
starcoder
package com.chaow.openutils.basic; import java.math.BigDecimal; /** * @author : Char * @date : 2019/8/15 * github : https://github.com/glassweichao/OpenUtils * desc : 高精度计算 */ public final class MathUtils { /** 默认精确度 */ private final static int DEFAULT_ACCURACY = 2; private final static int DEFA...
utils/src/main/java/com/chaow/openutils/basic/MathUtils.java
0.815159
0.41401
MathUtils.java
starcoder
package com.stevesun.solutions; /** * 393. UTF-8 Validation * * A character in UTF8 can be from 1 to 4 bytes long, subjected to the following rules: For 1-byte character, the first bit is a 0, followed by its unicode code. For n-bytes character, the first n-bits are all one's, the n+1 bit is 0, followed by n-1 b...
src/main/java/com/stevesun/solutions/_393.java
0.629775
0.436742
_393.java
starcoder
package jp.nayutaya.geodelta; import static jp.nayutaya.geodelta.Assert.assertArrayArrayEquals; import static org.junit.Assert.assertTrue; import java.util.HashSet; import java.util.Random; import java.util.Set; import org.junit.Test; public class RegionTest { @Test public void getDeltaIdsInRegion...
src/java/geodelta-test/src/jp/nayutaya/geodelta/RegionTest.java
0.763219
0.554169
RegionTest.java
starcoder
package net.obvj.junit.utils; import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import java.lang.reflect.Constructor; import java.la...
src/main/java/net/obvj/junit/utils/TestUtils.java
0.900627
0.602412
TestUtils.java
starcoder
package com.alibaba.alink.operator.common.statistics.basicstatistic; import com.alibaba.alink.common.linalg.DenseVector; import com.alibaba.alink.common.utils.TableUtil; import com.alibaba.alink.operator.common.utils.PrettyDisplayUtils; /** * It is summary result of sparse vector. * You can get vectorSize, mean, va...
core/src/main/java/com/alibaba/alink/operator/common/statistics/basicstatistic/TableSummary.java
0.857634
0.415966
TableSummary.java
starcoder
package DynamicProgramming; /** * Tiling Problem * <pre> * Given a "2 x n" board and tiles of size "2 x 1", count the number of ways to * tile the given board using the 2 x 1 tiles. A tile can either be placed * horizontally i.e., as a 1 x 2 tile or vertically i.e., as 2 x 1 tile. * See explanation at https://ww...
AlgotihmsJavaLibrary/src/DynamicProgramming/TilingProblem.java
0.862033
0.577376
TilingProblem.java
starcoder
package section41; public class MaximumSubarray { public static void main(String[] args) { int[] a = {2, -3, 11, -2, 4, 6, 0}; int[] retVals = findMaximumSubarray(a, 0, 6); for (int i = 0; i < retVals.length; i++) { System.out.println(retVals[i]); } System.out.println(); retVals = findMaximumSubarrayK...
Chapter 4 - Exercises/src/section41/MaximumSubarray.java
0.619011
0.432063
MaximumSubarray.java
starcoder
package cells; import javafx.scene.paint.Color; import java.util.Map; /** * Cell object implemented for each simulation implemented. * * Each cell should calculate and transition to the next state the cell should be in. * * The next state the cell should be in is determined according to the rules of each indivi...
src/cells/Cell.java
0.860281
0.557243
Cell.java
starcoder
package com.yusufaytas.leetcode; import static com.yusufaytas.leetcode.Utils.printArray; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.List; /* You are given an array of intervals, where intervals[i] = [starti, endi] and each starti is unique. The right inter...
src/main/java/com/yusufaytas/leetcode/FindRightInterval.java
0.877687
0.502136
FindRightInterval.java
starcoder
package us.ihmc.commonWalkingControlModules.controlModules; import us.ihmc.robotics.controllers.OrientationPIDGainsInterface; import us.ihmc.robotics.controllers.PositionPIDGainsInterface; import us.ihmc.robotics.controllers.SE3PIDController; import us.ihmc.robotics.controllers.SE3PIDGainsInterface; import us.ihmc.rob...
CommonWalkingControlModules/src/us/ihmc/commonWalkingControlModules/controlModules/RigidBodySpatialAccelerationControlModule.java
0.822831
0.633495
RigidBodySpatialAccelerationControlModule.java
starcoder
package org.recast4j.dynamic; import java.util.Optional; import java.util.function.BiFunction; import org.recast4j.recast.Heightfield; import org.recast4j.recast.Span; /** * Voxel raycast based on the algorithm described in * * "A Fast Voxel Traversal Algorithm for Ray Tracing" by <NAME> and <NAME> */ public cla...
detour-dynamic/src/main/java/org/recast4j/dynamic/VoxelQuery.java
0.84241
0.428473
VoxelQuery.java
starcoder
package functionalj.lens.lenses; import java.math.BigDecimal; import java.math.BigInteger; import functionalj.tuple.Tuple; import functionalj.tuple.Tuple2; public class IntMathOperators implements MathOperators<Integer> { public static MathOperators<Integer> instance = new IntMathOperators(); @Ove...
functionalj-core/src/main/java/functionalj/lens/lenses/IntMathOperators.java
0.896572
0.603757
IntMathOperators.java
starcoder
package ru.spbau.task4; import java.util.ArrayList; import java.util.Iterator; import java.util.LinkedList; import java.util.List; public final class Collections { private Collections() { } public static <T, U> U foldr(Iterable<? extends T> iterable, Function2<? super T, ? super U, ? extends U> f, U zero...
course-1/task-4-functional-java/src/main/java/ru/spbau/task4/Collections.java
0.887869
0.467393
Collections.java
starcoder
package JGraph; // Class To Compute The Shortest Paths From A Souce Vertex To All Other Vertices Using The Bellman-Ford Algorithm // If The Total Number Of Vertices Be N. Then The Graph Will Have Vertex Values From 0 To N-1 // Importing required packages import java.io.*; import java.util.*; public class Bellman_Fo...
Bellman_Ford.java
0.537527
0.430686
Bellman_Ford.java
starcoder
package training.binarysearchtree; import training.binarytree.TreeNode; import org.junit.jupiter.api.Test; import java.util.Deque; import java.util.LinkedList; import java.util.function.Predicate; import static training.binarytree.TreeNode.newTree; import static org.junit.jupiter.api.Assertions.assertFalse; import s...
src/training/binarysearchtree/Review_E98_Medium_ValidateBinarySearchTree.java
0.607547
0.475727
Review_E98_Medium_ValidateBinarySearchTree.java
starcoder
package org.neuroph.contrib.rnn.bptt; import java.util.Map; import org.jblas.DoubleMatrix; import org.neuroph.contrib.rnn.GRU; import org.neuroph.contrib.rnn.RNN; /** * * @author <NAME> <<EMAIL>> */ public class GRUBackPropagationThroughTime extends BackPropagationThroughTime { @Override public void propa...
neuroph/Contrib/src/main/java/org/neuroph/contrib/rnn/bptt/GRUBackPropagationThroughTime.java
0.860765
0.489686
GRUBackPropagationThroughTime.java
starcoder
package net.minecraft.server; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.concurrent.locks.ReadWriteLock; import java.util.concurrent.locks.ReentrantReadWriteLock; imp...
Server/work/decompile-8eb82bde/net/minecraft/server/DataWatcher.java
0.816297
0.410697
DataWatcher.java
starcoder
package com.nullpointerworks.color; /** * A container for holding floating-point color data. How the color is to be interpreted depends on the {@code ColorModel} since the color data is a generic {@code float[]}. All color data is assumed to be in the range [0,1]. All implemented color models in this library consist ...
src/com/nullpointerworks/color/Color.java
0.942804
0.565659
Color.java
starcoder
package unalcol.types.collection.tree.bplus.memory; import unalcol.types.collection.array.ArrayUtil; import unalcol.types.collection.tree.bplus.BPlusInnerNode; import unalcol.types.collection.tree.bplus.BPlusLeafNode; import unalcol.types.collection.tree.bplus.BPlusNode; /** * @author jgomez */ public class MemoryI...
src/main/java/unalcol/types/collection/tree/bplus/memory/MemoryInnerNode.java
0.823754
0.482002
MemoryInnerNode.java
starcoder
package org.lenskit.mooc.cbf; import java.util.HashMap; import java.util.Map; public class Helpers { public static double log(double x) { return logE(x); } public static double logE(double x) { return Math.log(x); } public static double log2(double x) { return log(x,2); } public st...
recommender-systems-specialization/recommender-systems-introduction/week-4/cbf-assignment/src/main/java/org/lenskit/mooc/cbf/Helpers.java
0.730674
0.560614
Helpers.java
starcoder
package com.joojet.plugins.mobs.util; import org.bukkit.util.Vector; public class MathUtil { /** Gravity constant used for falling blocks and thrown potions */ public static final double BLOCK_GRAVITY = 0.115; /** Gravity constant used for projectiles */ public static final double THROWN_PROJECTILE_GRAVITY = 0.0...
AGCraftPlugins/src/com/joojet/plugins/mobs/util/MathUtil.java
0.863406
0.517876
MathUtil.java
starcoder
package com.cinchapi.common.collect; import java.util.Collection; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; import javax.annotation.Nullable; import com.google.common.collect.Lists; import com.google.common.collect.Sets; /** * A collection of strategies for * {@...
src/main/java/com/cinchapi/common/collect/MergeStrategies.java
0.841403
0.511229
MergeStrategies.java
starcoder
package ac.keio.sslab.utils; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Set; import com.google.common.collect.Lists; // get/put inside a division are thread-safe public class ArrayMap<K, V> { List<Map<K, List<V>>> map; public ArrayMap(int c...
src/main/java/ac/keio/sslab/utils/ArrayMap.java
0.793746
0.432842
ArrayMap.java
starcoder
package us.ihmc.atlas.parameters; import static us.ihmc.sensorProcessing.sensorProcessors.SensorProcessing.SensorType.FORCE_SENSOR; import static us.ihmc.sensorProcessing.sensorProcessors.SensorProcessing.SensorType.IMU_ANGULAR_VELOCITY; import static us.ihmc.sensorProcessing.sensorProcessors.SensorProcessing.SensorTy...
Atlas/src/us/ihmc/atlas/parameters/AtlasStateEstimatorParameters.java
0.869091
0.428532
AtlasStateEstimatorParameters.java
starcoder
package org.vitrivr.cineast.core.util.audio.pitch; import org.vitrivr.cineast.core.util.dsp.FrequencyUtils; import org.vitrivr.cineast.core.util.dsp.midi.MidiUtil; /** * This class represents a single pitch as returned for instance by pitch estimation classes or used by * pitch tracking classes. A pitch can be eith...
cineast-core/src/main/java/org/vitrivr/cineast/core/util/audio/pitch/Pitch.java
0.950846
0.557725
Pitch.java
starcoder
package com.eg366.al.algorithms.sort; import java.util.Arrays; /** * 快速排序 */ public class QuickSort01 { private void sort(int[] a) { this.doSort(a, 0, a.length - 1); } /** * 递归执行排序 * * @param a 数组 * @param p 排序开始索引下标 * @param r 排序结束索引下标 */ private void doSort(...
src/main/java/com/eg366/al/algorithms/sort/QuickSort01.java
0.616243
0.457743
QuickSort01.java
starcoder
package com.softicar.platform.dom.elements.input.auto; import com.softicar.platform.common.core.utils.DevNull; import java.util.Collection; import java.util.Optional; public interface IDomAutoCompletePreferenceInputEngine<T> extends IDomAutoCompleteInputEngine<T> { /** * Determines a Collection of items which mat...
platform-dom/src/main/java/com/softicar/platform/dom/elements/input/auto/IDomAutoCompletePreferenceInputEngine.java
0.821474
0.402744
IDomAutoCompletePreferenceInputEngine.java
starcoder
package me.learn.personal.month4; import java.util.Arrays; /** * Title 475 : * * Winter is coming! Your first job during the contest is to design a standard heater with fixed warm radius to warm all the houses. Now, you are given positions of houses and heaters on a horizontal line, find out minimum radius of h...
src/me/learn/personal/month4/Heaters.java
0.707304
0.774669
Heaters.java
starcoder
package willem.weiyu.algorithm.leetCode; import java.util.ArrayList; import java.util.Arrays; import java.util.List; /** * @author: willem * @create: 2021/02/21 13:27 * @description: 给定一个包含n个整数的数组nums和一个目标值target,判断nums中是否存在四个元素 a,b,c和d,使得a+b+c+d的值与target相等找出所有满足条件且不重复的四元组 * https://leetcode-cn.com/problems/4sum/...
src/main/java/willem/weiyu/algorithm/leetCode/No18.java
0.700792
0.488222
No18.java
starcoder
package com.amazonaws.services.kinesis.model; import java.io.Serializable; import com.amazonaws.AmazonWebServiceRequest; /** * Container for the parameters to the {@link com.amazonaws.services.kinesis.AmazonKinesis#getRecords(GetRecordsRequest) GetRecords operation}. * <p> * Gets data records from a shard. * </p...
src/main/java/com/amazonaws/services/kinesis/model/GetRecordsRequest.java
0.946113
0.468183
GetRecordsRequest.java
starcoder
package com.michaelburgstaller.adventofcode.sevensegmentsearch; import com.michaelburgstaller.adventofcode.common.Exercise; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.stream.Collectors; public class SevenSegmentSearch extends Exercise { priva...
day-08-seven-segment-search/src/main/java/com/michaelburgstaller/adventofcode/sevensegmentsearch/SevenSegmentSearch.java
0.911503
0.409457
SevenSegmentSearch.java
starcoder
package com.codility.lesson.three; /*** * A non-empty zero-indexed array A consisting of N integers is given. Array A * represents numbers on a tape. * * Any integer P, such that 0 < P < N, splits this tape into two non-empty * parts: A[0], A[1], ..., A[P − 1] and A[P], A[P + 1], ..., A[N − 1]. * * The differen...
src/main/java/com/codility/lesson/three/TapeEquilibrium.java
0.933347
0.763528
TapeEquilibrium.java
starcoder
package com.sk89q.worldedit.regions; /** * Utility methods relating to {@link Region}s. */ public final class Regions { private Regions() { } /** * Get the minimum Y coordinate of the given region using the region's * {@link Region#getMinimumPoint()} method. * * @param region the re...
worldedit-core/src/main/java/com/sk89q/worldedit/regions/Regions.java
0.964456
0.710453
Regions.java
starcoder
package org.apache.iotdb.library.dprofile.util; import org.apache.iotdb.library.util.LinearRegression; import org.apache.commons.lang3.ArrayUtils; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; /** Util for segment. */ public class Segment { private static double calculate_erro...
library-udf/src/main/java/org/apache/iotdb/library/dprofile/util/Segment.java
0.834508
0.42185
Segment.java
starcoder
package cells; /** * The LifeCell used for the the Game Of Life simulation. * @author <NAME>, <NAME>, and <NAME> */ import java.util.List; import java.util.Map; import cellsociety_team25.SimulationModel; import edgeCases.IEdgeCase; public class LifeCell extends Cell { private int DEATH = 0; private int LIFE = ...
src/cells/LifeCell.java
0.755005
0.408631
LifeCell.java
starcoder
package com.google.j2cl.transpiler.regression.mediumbridgesshard44; import junit.framework.TestCase; public class TestShard extends TestCase { public void testShards() { TestCase12417.test(); TestCase12449.test(); TestCase1299.test(); TestCase1673.test(); TestCase3431.test(); TestCase4575.te...
transpiler/javatests/com/google/j2cl/transpiler/regression/mediumbridgesshard44/TestShard.java
0.52683
0.723224
TestShard.java
starcoder
package org.bananarama.crud; import com.googlecode.cqengine.query.option.QueryOptions; import java.util.List; import java.util.stream.Stream; import org.bananarama.io.DataCollector; /** * * @author <NAME> */ public interface ReadOperation<T> extends BasicOperation{ /** * Return all the data contained...
bananarama-core/src/main/java/org/bananarama/crud/ReadOperation.java
0.846609
0.451447
ReadOperation.java
starcoder
package com.vertumno.knn; import java.util.*; import java.util.stream.Collectors; public final class KNearestNeighbors { private KNearestNeighbors(){} private static double euclideanDistance(IrisFlower p1, IrisFlower p2) { double distance = Math.pow( (p2.petal_length - p1.petal_length), 2 ) + Math.pow( ...
K-Nearest-Neighbors/src/main/java/com/vertumno/knn/KNearestNeighbors.java
0.647241
0.511046
KNearestNeighbors.java
starcoder
package ivorius.pandorasbox.random; import java.util.Random; public class PandorasBoxItemNamer { public static String[] prefixesB = new String[]{"The", "The one and only", "Our", "Everyone's", "Woodcutter's", "Notch's", "Miner's", "Steve's", "Creeper's", "A", "Similar to the", "Your", "A copy of the"}; public...
src/main/java/ivorius/pandorasbox/random/PandorasBoxItemNamer.java
0.554229
0.444203
PandorasBoxItemNamer.java
starcoder
package android.hardware.cts.helpers.sensorverification; import junit.framework.Assert; import android.hardware.Sensor; import android.hardware.cts.helpers.SensorCtsHelper; import android.hardware.cts.helpers.SensorStats; import android.hardware.cts.helpers.TestSensorEnvironment; import android.hardware.cts.helpers.T...
app/src/main/java/android/hardware/cts/helpers/sensorverification/JitterVerification.java
0.940817
0.4016
JitterVerification.java
starcoder
import java.util.*; public class ThreeSum_15 { /** * Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero. * * Note: * * The solution set must not contain duplicate triplets. * ...
src/ThreeSum_15.java
0.82734
0.520984
ThreeSum_15.java
starcoder
package de.amr.games.pacman.view.common; import static de.amr.games.pacman.PacManApp.settings; import static de.amr.games.pacman.controller.creatures.ghost.GhostState.CHASING; import static de.amr.games.pacman.view.common.Rendering.alpha; import static de.amr.games.pacman.view.common.Rendering.drawDirectionIndicator; ...
PacManGame/src/main/java/de/amr/games/pacman/view/common/RoutesRenderer.java
0.671147
0.405861
RoutesRenderer.java
starcoder
package common; /** * @author <NAME> */ public class Geometry { /** * Given a point and a segment. * <p> * Returns true if the point is in the segment * * @param p * @param s * @return */ public static boolean onSegment( Point p, Segment s ...
GeekForGeeks/src/common/Geometry.java
0.860413
0.546557
Geometry.java
starcoder
package com.stephenwranger.graphics.renderables; import com.stephenwranger.graphics.math.Quat4d; import com.stephenwranger.graphics.math.Tuple3d; public abstract class RenderablePhysics extends Renderable { private final double mass; private final double restitution; private double uS; private double uK; ...
src/java/com/stephenwranger/graphics/renderables/RenderablePhysics.java
0.93511
0.482917
RenderablePhysics.java
starcoder