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 jet.opengl.demos.postprocessing; import com.nvidia.developer.opengl.app.NvSampleApp; import org.lwjgl.util.vector.Matrix4f; import java.io.IOException; import jet.opengl.postprocessing.common.GLFuncProvider; import jet.opengl.postprocessing.common.GLFuncProviderFactory; import jet.opengl.postprocessing.comm...
testframewok/src/main/java/jet/opengl/demos/postprocessing/RadiualBlurDemo.java
0.696165
0.414425
RadiualBlurDemo.java
starcoder
Provides interfaces for the engine's index system; the API for Ontopia topic map indexes. This package enables quick retrieval of selected topic map content; using these interfaces, these facilities can be used without any dependencies on the repository-specific backend(s) used for managing the topic map data. <br>NB t...
ontopia-engine/src/main/java/net/ontopia/topicmaps/core/index/package-info.java
0.760384
0.709217
package-info.java
starcoder
package us.ihmc.humanoidRobotics.communication.packets.walking; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Random; import javax.vecmath.Point2d; import javax.vecmath.Point3d; import javax.vecmath.Quat4d; import us.ihmc.communication.packets.Packet; import us.ihmc.com...
IHMCHumanoidRobotics/src/us/ihmc/humanoidRobotics/communication/packets/walking/AdjustFootstepMessage.java
0.845624
0.45847
AdjustFootstepMessage.java
starcoder
package com.severalcircles.flames.data.user; import com.severalcircles.flames.data.FlamesData; import com.severalcircles.flames.util.Rank; import org.jetbrains.annotations.NotNull; import java.time.Instant; import java.util.Properties; /** * Represents Fun Facts data for a FlamesUser */ public class UserFunFacts i...
src/main/java/com/severalcircles/flames/data/user/UserFunFacts.java
0.817611
0.407982
UserFunFacts.java
starcoder
package ai.konduit.serving.tensorrt; import ai.konduit.serving.annotation.json.JsonName; import ai.konduit.serving.pipeline.api.step.PipelineStep; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.Accessors; import org.nd4j.shade.jackson....
konduit-serving-tensorrt-config/src/main/java/ai/konduit/serving/tensorrt/TensorRTStep.java
0.603231
0.465023
TensorRTStep.java
starcoder
package com.theisleoffavalon.mcmanager.permission; import static org.junit.Assert.*; import org.junit.Test; /** * Tests the basic {@link IPermission} interface implementation. * Since we are testing an abstract implementation we will be using * the {@link GenericPermission} class as our instance type. * * @aut...
mod-test/com/theisleoffavalon/mcmanager/permission/TestIPermission.java
0.718496
0.401981
TestIPermission.java
starcoder
package edu.rice.cs.plt.collect; import java.util.Iterator; import java.util.Map; import java.io.Serializable; import edu.rice.cs.plt.tuple.Pair; import edu.rice.cs.plt.lambda.Lambda; import edu.rice.cs.plt.lambda.Runnable1; import edu.rice.cs.plt.iter.MappedIterator; import edu.rice.cs.plt.iter.EmptyIterator; import ...
src/main/java/edu/rice/cs/plt/collect/AbstractInjectiveRelation.java
0.884925
0.496521
AbstractInjectiveRelation.java
starcoder
package ru.job4j.condition; /** * Программа для расчета площади треугольника. * * @author <NAME> (<EMAIL>). */ public class Triangle { Point point1, point2, point3; //координаты вершин. double a, b, c; //длины сторон. /** * Конструктор треугольника по вершинам. * @param point1 вершина 1. ...
chapter_001/src/main/java/ru/job4j/condition/Triangle.java
0.538255
0.499146
Triangle.java
starcoder
package learning.models; import learning.interfaces.Mergeable; import learning.interfaces.ModelHolder; import learning.interfaces.ProbabilityModel; import learning.utils.Matrix; import learning.utils.SparseVector; import peersim.config.Configuration; import peersim.core.CommonState; /** * It is a single layer neural...
src/learning/models/SoftmaxRegression.java
0.874681
0.477676
SoftmaxRegression.java
starcoder
package edu.ucsb.cs56.pconrad.parsing.tokenizer; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.fail; import org.junit.Test; public class TokenizerAddonsTest { private TokenFactory tf = new DefaultTokenFactory(); @Test pu...
src/edu/ucsb/cs56/pconrad/parsing/tokenizer/TokenizerAddonsTest.java
0.600423
0.726789
TokenizerAddonsTest.java
starcoder
package org.apache.ignite.ml.nn.architecture; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import org.apache.ignite.ml.math.functions.IgniteDifferentiableDoubleToDoubleFunction; /** * Class containing information about architecture of MLP. */ public class MLPArchitecture implement...
modules/ml/src/main/java/org/apache/ignite/ml/nn/architecture/MLPArchitecture.java
0.958596
0.456228
MLPArchitecture.java
starcoder
package com.gilleland.george.objects; import java.util.EmptyStackException; /** * Created by <NAME> on 11/2/2015. */ public class StackLinkedList { /** * The head node for the underlying Linked List */ public StackLink head; /** * The number of elements currently in the stack */ ...
src/main/com/gilleland/george/objects/StackLinkedList.java
0.899734
0.459015
StackLinkedList.java
starcoder
package game.main.positionable; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.math.Rectangle; import game.main.positionable.entity.Entity; import game.resource.SpriteSheet; /** * Describes a rectangle offset by specified x and y values multiplier to * a given entity. Uses {@link Rectangl...
core/src/game/main/positionable/Hitbox.java
0.967686
0.54825
Hitbox.java
starcoder
package depth_first_search.all_subsets; public class Q494TargetSum { //TAG: Google //TAG: Facebook //TAG: dfs //TAG: dp //Difficulty: meidum /** * 494. Target Sum * You are given a list of non-negative integers, a1, a2, ..., an, and a target, S. Now you have 2 symbols + and -. For e...
src/depth_first_search/all_subsets/Q494TargetSum.java
0.834238
0.598928
Q494TargetSum.java
starcoder
package io.reinert.requestor.core; /** * A factory of delay sequences. * * @author <NAME> */ public class DelaySequence { /** * Converts the given seconds array to a milliseconds array. * * @param seconds An array of delays in seconds * * @return The given array converted to milliseco...
requestor/core/requestor-api/src/main/java/io/reinert/requestor/core/DelaySequence.java
0.920545
0.544196
DelaySequence.java
starcoder
package org.uncommons.watchmaker.examples.sudoku; /** * A potential solution for a Sudoku puzzle. * @author <NAME> */ public final class Sudoku { /** The dimensions (in cells) of the puzzle square. */ public static final int SIZE = 9; private static final int MIN_VALUE = 1; private static final int ...
examples/src/java/main/org/uncommons/watchmaker/examples/sudoku/Sudoku.java
0.861989
0.497742
Sudoku.java
starcoder
public class Problem109 { /** * Inner TreeNode class to represent Tree data structure */ private static class TreeNode { int val; TreeNode left, right; TreeNode(int val) { this.val = val; } } /** * Inner ListNode class to represent LinkedList...
Problem 109/Problem109.java
0.926835
0.627666
Problem109.java
starcoder
package org.firstinspires.ftc.teamcode.vision; import com.acmerobotics.roadrunner.geometry.Vector2d; public class CameraTargetDistance { // Object Dimensions - width, height /** * the dimensions of a Ball in inches (width, height) */ public static final Vector2d BALL_DIM = new Vector2d( 2.75, 2.75 ); // 14.75...
TeamCode/src/main/java/org/firstinspires/ftc/teamcode/vision/CameraTargetDistance.java
0.852506
0.826607
CameraTargetDistance.java
starcoder
package com.demshape.factorization.dataset; import com.demshape.factorization.datastructure.DataPoint; import com.demshape.factorization.datastructure.SparseVector; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import java.io.*; import java.util.*; import java.util.concurrent.Con...
src/main/java/com/demshape/factorization/dataset/DenseMapper.java
0.941446
0.566918
DenseMapper.java
starcoder
package com.concellgrid; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Solution { static int visited[][] = new int[10][10]; public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader reader = new BufferedReader(ne...
HackerRank/ConnectedCellInAGrid/Solution.java
0.628293
0.478285
Solution.java
starcoder
package org.mufuku.sudoku.solver.alpha.solver; import org.mufuku.sudoku.solver.alpha.reader.SymbolIndex; import org.mufuku.sudoku.solver.alpha.strategies.ISolveStrategy; import java.util.*; /** * @author <NAME> (<EMAIL>) */ public class Table { private final Cell[][] cells; private final int height; ...
src/main/java/org/mufuku/sudoku/solver/alpha/solver/Table.java
0.884114
0.447762
Table.java
starcoder
package ch.skymarshall.tcwriter.generators.recorder; import static ch.skymarshall.tcwriter.generators.model.testapi.TestParameterFactory.simpleType; import java.io.IOException; import java.nio.file.Path; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.uti...
testcase-writer/generators/src/main/java/ch/skymarshall/tcwriter/generators/recorder/TestCaseRecorder.java
0.76366
0.419588
TestCaseRecorder.java
starcoder
package nl.bartpelle.veteres.model.entity; import nl.bartpelle.veteres.model.Area; import nl.bartpelle.veteres.model.Entity; import nl.bartpelle.veteres.model.Tile; import nl.bartpelle.veteres.model.map.MapObj; import nl.bartpelle.veteres.util.Varp; import java.util.Iterator; import java.util.LinkedList; /** * Crea...
server/src/main/java/nl/bartpelle/veteres/model/entity/PathQueue.java
0.817611
0.416915
PathQueue.java
starcoder
package com.johndev4.calculatorproject; import com.fathzer.soft.javaluator.Constant; import com.fathzer.soft.javaluator.DoubleEvaluator; import com.fathzer.soft.javaluator.Function; import com.fathzer.soft.javaluator.Parameters; import org.apache.commons.math3.util.FastMath; import java.util.Iterator; /** * * @au...
app/src/main/java/com/johndev4/calculatorproject/ExtendedDoubleEvaluator.java
0.708717
0.491517
ExtendedDoubleEvaluator.java
starcoder
package dk.dma.nearmiss.engine.geometry.geometries; import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.GeometryFactory; import org.locationtech.jts.geom.Polygon; /** * This class represents the contour of a vessel. * * It is intended to model the contour of "other vessels" when analysing...
near-miss-engine/src/main/java/dk/dma/nearmiss/engine/geometry/geometries/VesselContour.java
0.898664
0.561696
VesselContour.java
starcoder
package com.mmnaseri.utils.dareader.utils; /** Simple class that can be used to check preconditions. */ public final class Precondition { private Precondition() throws IllegalAccessException { throw new IllegalAccessException("This type should not be instantiated."); } /** * Checks the state of the give...
dareader/src/main/java/com/mmnaseri/utils/dareader/utils/Precondition.java
0.927083
0.422564
Precondition.java
starcoder
package stexfires.core; import stexfires.core.mapper.fieldvalue.FieldValueMapper; import stexfires.core.mapper.fieldvalue.IdentityFieldValueMapper; import java.util.Arrays; import java.util.Collection; import java.util.Comparator; import java.util.List; import java.util.Objects; import java.util.function.Supplier; im...
src/main/java/stexfires/core/Fields.java
0.913141
0.444565
Fields.java
starcoder
import static org.junit.Assert.*; import org.junit.Before; import org.junit.Test; public class SalesTaxesTest { private Cart cart; private Good perfume, chocoBox, book; private priceGetter priceGetter; @Before public void setUp() throws Exception { priceGetter = new priceCalculator(); cart = new Cart(pric...
src/SalesTaxesTest.java
0.682679
0.504333
SalesTaxesTest.java
starcoder
package tensor; import algebra.utils.AlgebraException; import table.DenseNDArray; import java.util.Arrays; import java.util.function.Function; /** * The type Matrix. * * @param <I> the type parameter */ public class Matrix<I extends AlgebraField> extends DenseNDArray<I> { /** * Instantiates a new Matrix...
src/main/java/tensor/Matrix.java
0.918777
0.447762
Matrix.java
starcoder
import java.util.ArrayList; import java.util.HashMap; public class Village { private HashMap<Potion, Integer> registrePotions = new HashMap<>(); private ArrayList<IntervallePotion> intervalleDePrisesPotions; // Comme un tableau à 2 entrées (valeur : intervalle entre les 2 potions) // private Quartier quar...
src/Village.java
0.694303
0.468547
Village.java
starcoder
package kendzi.josm.kendzi3d.jogl.model.roof.mk.type; import java.util.Arrays; import java.util.List; import javax.vecmath.Point2d; import javax.vecmath.Point3d; import javax.vecmath.Vector3d; import kendzi.jogl.model.factory.MeshFactory; import kendzi.jogl.model.factory.MeshFactoryUtil; import kendzi.jog...
kendzi3d-buildings/src/main/java/kendzi/josm/kendzi3d/jogl/model/roof/mk/type/RoofTypePyramidal.java
0.71423
0.513851
RoofTypePyramidal.java
starcoder
package com.acuity.visualisations.common.util; import java.math.BigDecimal; import java.util.Date; import org.apache.commons.lang3.math.NumberUtils; /** * This is because H2 and oracle return different values for max/min for dates etv * * @author ksnd199 */ public final class ObjectConvertor { private Objec...
vahub-common/src/main/java/com/acuity/visualisations/common/util/ObjectConvertor.java
0.895944
0.443299
ObjectConvertor.java
starcoder
package ml.cristatus.euler.utils; import java.math.BigInteger; import static java.math.BigInteger.*; /** * A useful class that has functionality to support several functions of * counting theory, like Permutations, Combinations, etc. * * @author <NAME> * @version 1.0 */ public class Count { /** * Thi...
src/ml/cristatus/euler/utils/Count.java
0.885718
0.536616
Count.java
starcoder
package de.lighti.clipper; import java.util.ArrayList; /** * A pure convenience class to avoid writing List<Path> everywhere. * * @author <NAME> */ public class Paths extends ArrayList<Path> { /** * */ private static final long serialVersionUID = 1910552127810480852L; public Paths() { super(); ...
third-party-java/de/lighti/clipper/Paths.java
0.869562
0.462594
Paths.java
starcoder
package threesumClosest; import java.util.Arrays; /** * Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have exactly one solution. * <p/> * For example, given array S = {-1 2 ...
leetcode/src/threesumClosest/Solution.java
0.866486
0.59564
Solution.java
starcoder
package edu.bits.wilp.ir_assignment.math; import org.apache.commons.math3.exception.OutOfRangeException; import org.apache.commons.math3.exception.util.LocalizedFormats; import org.apache.commons.math3.util.Decimal64; import org.apache.commons.math3.util.OpenIntToFieldHashMap; public class SparseVector { private ...
src/main/java/edu/bits/wilp/ir_assignment/math/SparseVector.java
0.898218
0.484807
SparseVector.java
starcoder
package lambdasinaction.chap5; import org.junit.Test; import java.net.URL; import java.util.*; import java.util.function.IntSupplier; import java.util.stream.*; import java.nio.charset.Charset; import java.nio.file.*; /** * @author Administrator */ public class BuildingStreams { @Test public void testIter...
src/main/java/lambdasinaction/chap5/BuildingStreams.java
0.598547
0.431644
BuildingStreams.java
starcoder
package one.digitalinnovation.map; import java.util.Iterator; import java.util.Map; import java.util.TreeMap; public class ExemploTreeMap { public static void main(String[] args) { TreeMap<String, String> treecapitais = new TreeMap<>(); //Monta a árvore com as capitais treecapitais.put("...
Bootcamps/Code Anywhere/Implementando Collections e Streams com Java/src/one/digitalinnovation/map/ExemploTreeMap.java
0.713831
0.40536
ExemploTreeMap.java
starcoder
package fr.mercury.nucleus.math.objects; import fr.alchemy.utilities.Validator; import fr.alchemy.utilities.collections.pool.Reusable; import fr.mercury.nucleus.math.MercuryMath; import fr.mercury.nucleus.math.readable.ReadableQuaternion; /** * <code>Quaternion</code> defines a rotation in 4 dimensions instead of 3,...
mercury-nucleus/src/fr/mercury/nucleus/math/objects/Quaternion.java
0.939554
0.593786
Quaternion.java
starcoder
import java.util.LinkedList; import org.junit.Test; import static org.junit.Assert.*; import static common.TreeUtils.*; import common.TreeNode2; /** * Cracking the Coding Interview(5ed) Problem 4.8: * Given two very large binary trees: Tl(millions of nodes) and T2(hundreds of * nodes), check if T2 is a subtree of...
ctci/tree_graph/CheckSubtree.java
0.861916
0.505493
CheckSubtree.java
starcoder
package frc.robot; import edu.wpi.first.wpilibj.kinematics.DifferentialDriveKinematics; /** * The Constants class provides a convenient place for teams to hold robot-wide * numerical or boolean constants. This class should not be used for any other * purpose. All constants should be declared globally (i.e. public...
src/main/java/frc/robot/Constants.java
0.673192
0.419232
Constants.java
starcoder
package edu.cmu.graphchi.walks; import edu.cmu.graphchi.ChiVertex; import edu.cmu.graphchi.EdgeDirection; import java.util.Arrays; import java.util.Random; /** * This class takes a vertex with <b>weighted</b> edges and * generates an array of random hops. Note: the hops are edge-indices, * not the edges themselve...
src/main/java/edu/cmu/graphchi/walks/WeightedHopper.java
0.649134
0.424293
WeightedHopper.java
starcoder
package pl.info.rkluszczynski.image.core.compare; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.awt.*; import java.util.Arrays; /* Based on: http://www.dreamincode.net/forums/topic/126389-pearson-correlation-in-java/ http://www.statisticshowto.com/what-is-the-pearson-correlation-coefficient...
image-core/src/main/java/pl/info/rkluszczynski/image/core/compare/PersonCorrelation.java
0.692434
0.412353
PersonCorrelation.java
starcoder
package com.andremanuelbarbosa.euromillions.predictor.manager; import com.andremanuelbarbosa.euromillions.predictor.algorithms.Algorithm; import com.andremanuelbarbosa.euromillions.predictor.domain.Formula; import com.andremanuelbarbosa.euromillions.predictor.helper.MathHelper; import com.google.common.collect.Lists; ...
src/main/java/com/andremanuelbarbosa/euromillions/predictor/manager/FormulasManager.java
0.894631
0.537223
FormulasManager.java
starcoder
package com.opengamma.analytics.financial.equity.future; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.commons.lang.Validate; import com.google.common.collect.Lists; import com.opengamma.analytics.financial.equity.future.derivative.EquityFuture; import com.opengamma.analyti...
src/com/opengamma/analytics/financial/equity/future/EquityFuturesRatesSensitivityCalculator.java
0.93716
0.607809
EquityFuturesRatesSensitivityCalculator.java
starcoder
package adnascreen; import java.util.ArrayList; import java.util.List; /** * Paired read for Reichlab ancient DNA * The paired read is a merged result of forward and reverse reads * with merging, and barcode and adapter trimming * @author <NAME> * */ public class MergedRead extends Read{ private IndexAndBarcod...
src/main/java/adnascreen/MergedRead.java
0.578448
0.425963
MergedRead.java
starcoder
package kchandra423.kTesting.kAssertions; import java.util.Arrays; interface Assertion { static void kAssert(Object expected, Assertion assertion) { Object output = assertion.getOutput(); if (!Assertion.equals(expected, output)) { assertion.throwKAssertionException(output, expected); ...
src/main/java/kchandra423/kTesting/kAssertions/Assertion.java
0.792424
0.727443
Assertion.java
starcoder
package model; import java.util.*; /** * Outlines a state of a single game. */ public class Game { /** * Points is a 26-items long array. Even though there are only 24 points in the * board, we use the first and the last one as a bar. Positive values of items * represent black checkers while ne...
src/model/Game.java
0.946076
0.579043
Game.java
starcoder
package tree; import java.util.ArrayList; import java.util.List; public class TreeNode { private String data = null; private List<TreeNode> children = new ArrayList<>(); private TreeNode parent = null; public TreeNode(String data) { this.data = data; } public void addChildSorted(TreeNode child) { boole...
org.modelia.modelmanagement/src/tree/TreeNode.java
0.671363
0.439507
TreeNode.java
starcoder
package io.indexr.query.expr; import com.google.common.collect.Lists; import org.apache.spark.unsafe.types.UTF8String; import java.util.Collections; import java.util.List; import io.indexr.query.row.InternalRow; import io.indexr.query.types.DataType; import io.indexr.query.types.TypeConverters; public class Cast e...
indexr-query-opt/src/main/java/io/indexr/query/expr/Cast.java
0.80479
0.508361
Cast.java
starcoder
package com.polban.tekpro.monopoly; import java.awt.Dimension; import java.util.List; import com.polban.tekpro.monopoly.gui.GameBoardUtil; import junit.framework.TestCase; public class GameboardCreationTest extends TestCase{ public void testCellAddOrder() { GameBoard board = new SimpleGameBoard(); List north...
Week14_TekproPrak/Monopoly/src/com/polban/tekpro/monopoly/GameboardCreationTest.java
0.80525
0.428532
GameboardCreationTest.java
starcoder
package org.firstinspires.ftc.robotcontroller.internal; import com.qualcomm.robotcore.eventloop.opmode.Autonomous; import com.qualcomm.robotcore.eventloop.opmode.Disabled; /** * Updated by <NAME> on 2/11/2019. * * Purpose: This program is meant to be a template/guide for creating any autonomous program * ...
FtcRobotController/src/main/java/org/firstinspires/ftc/robotcontroller/internal/AutoTemplate.java
0.683736
0.496033
AutoTemplate.java
starcoder
package io.github.data4all.model.drawing; import io.github.data4all.model.data.DataElement; import java.util.List; import android.graphics.Color; /** * A MotionInterpreter uses {@link DrawingMotion DrawingMotions} to interpret * the motions in the context of the specific interpreter and generates a * polygon tha...
src/main/java/io/github/data4all/model/drawing/MotionInterpreter.java
0.868771
0.476945
MotionInterpreter.java
starcoder
package de.floatec.u_r_burning_out; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.math.Vector2; /** * Created by johannesheiler on 25.02.15. */ public class Button { private Texture texture; private Texture textureSelected; private Texture texturePressed...
core/src/de/floatec/u_r_burning_out/Button.java
0.551091
0.451689
Button.java
starcoder
package com.linkedin.dagli.data.schema; import java.util.Collection; /** * Defines a schema for reading objects from "rows" where each field of the object corresponds to an integer- * indexed column. * * @param <T> the type of object being read * @param <A> a mutable "accumulator" object that will be used to co...
core/src/main/java/com/linkedin/dagli/data/schema/RowSchema.java
0.940079
0.627352
RowSchema.java
starcoder
package com.learn.myspring.aop; import com.learn.myspring.utils.ClassUtils; /** * Description: * date: 2021/8/18 17:39 * Package: com.learn.myspring.aop * * @author 李佳乐 * @email <EMAIL> */ @SuppressWarnings("all") public class TargetSource { /* spring代理与aop:spring代理在支持aop,面向切面编程的同时,为spring自身的扩展及对其他框...
src/main/java/com/learn/myspring/aop/TargetSource.java
0.568176
0.401923
TargetSource.java
starcoder
package training.binarysearch; import org.junit.jupiter.api.Test; import util.datastructure.function.TriFunction; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import static java.util.Arrays.asList; import static org.junit.jupiter.api.Assertions.assertEquals; /** * 658. 找到 K 个最接近的元素: ...
src/training/binarysearch/E658_Medium_FindKClosestElements.java
0.802749
0.514888
E658_Medium_FindKClosestElements.java
starcoder
package polinomios.vectores.forma1; /** * * @author alejandroescobar */ public class PolinomioVectorForma1 { private int[] arregloA; /** * Constructor que crea un arreglo sin coeficientes de grado n * * @param n es el grado */ public PolinomioVectorForma1(int n) { ...
src/polinomios/vectores/forma1/PolinomioVectorForma1.java
0.691602
0.404802
PolinomioVectorForma1.java
starcoder
class Solution { List<Integer> nodes; public List<Integer> boundaryOfBinaryTree(TreeNode root) { nodes = new ArrayList<>(); if (root == null) { return nodes; } nodes.add(root.val); addLeftBoundary(root.left); addLeaves(root.left); ...
new/2021/11/17/yyf-lc545.java
0.90742
0.575648
yyf-lc545.java
starcoder
package com.lhkbob.imaje.io.dds; import com.lhkbob.imaje.data.Bytes; import com.lhkbob.imaje.io.InvalidImageException; import java.io.IOException; import java.nio.ByteBuffer; import static com.lhkbob.imaje.io.dds.DDSHeader.isFlagSet; import static com.lhkbob.imaje.io.dds.DDSHeader.setFlag; /** * Stores the pixel f...
src/main/java/com/lhkbob/imaje/io/dds/DDSPixelFormat.java
0.731059
0.420243
DDSPixelFormat.java
starcoder
import java.lang.reflect.Method; public class Main { // A dummy value to defeat inlining of these routines. static boolean doThrow = false; public static void assertIntEquals(int expected, int result) { if (expected != result) { throw new Error("Expected: " + expected + ", found: " + result); } ...
test/565-checker-doublenegbitwise/src/Main.java
0.684053
0.546496
Main.java
starcoder
package personal.wuyi.datarecord; import com.google.common.base.Preconditions; import java.io.Serializable; import java.util.LinkedHashMap; import java.util.Map; import java.util.NoSuchElementException; /** * Generic data type for dynamic number of fields and different type of fields. * * <p>The structure of {@c...
src/java/personal/wuyi/datarecord/DataRecord.java
0.927847
0.555315
DataRecord.java
starcoder
package us.ihmc.simulationconstructionset.gui; import us.ihmc.jMonkeyEngineToolkit.camera.CameraConfiguration; import us.ihmc.simulationconstructionset.ViewportConfiguration; public class StandardViewSetup { public static void setupStandardViews(StandardSimulationGUI standardSimulationGUI) { // Camera an...
SimulationConstructionSet/src/us/ihmc/simulationconstructionset/gui/StandardViewSetup.java
0.697506
0.419291
StandardViewSetup.java
starcoder
public class TunableLens extends Lens { /* * Constructor for a tunable lens. Start focal length is the focal length is focal length at * which lens starts. */ public TunableLens(double position, double minFocalLength, double maxFocalLength, double startFocalLength, String name) { super(position, startFo...
src/TunableLens.java
0.695648
0.403861
TunableLens.java
starcoder
package com.matez.wildnature.entity.AI.Navigator; import net.minecraft.entity.CreatureEntity; import net.minecraft.entity.ai.RandomPositionGenerator; import net.minecraft.pathfinding.PathNavigator; import net.minecraft.tags.FluidTags; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; ...
src/main/java/com/matez/wildnature/entity/AI/Navigator/WNRandomPosGen.java
0.744471
0.409516
WNRandomPosGen.java
starcoder
package co.edu.uniandes.csw.turismo.resources; import co.edu.uniandes.csw.turismo.dtos.ValoracionesDTO; import co.edu.uniandes.csw.turismo.dtos.ValoracionesDetailDTO; import co.edu.uniandes.csw.turismo.ejb.PlanLogic; import co.edu.uniandes.csw.turismo.entities.ValoracionesEntity; import co.edu.uniandes.csw.turismo.ent...
turismo-web/src/main/java/co/edu/uniandes/csw/turismo/resources/Plan_ValoracionesResource.java
0.640074
0.51946
Plan_ValoracionesResource.java
starcoder
package net.modificationstation.stationapi.api.util.math; import java.nio.FloatBuffer; public final class Matrix4f { float a00; float a01; float a02; float a03; float a10; float a11; float a12; float a13; float a20; float a21; float a22; float a23; float a30; fl...
station-api-base/src/main/java/net/modificationstation/stationapi/api/util/math/Matrix4f.java
0.752195
0.480235
Matrix4f.java
starcoder
package gedi.core.data.reads; import java.util.HashMap; import java.util.function.DoubleUnaryOperator; import gedi.util.ArrayUtils; import gedi.util.datastructure.array.NumericArray; import gedi.util.datastructure.array.NumericArray.NumericArrayType; import gedi.util.datastructure.array.sparse.AutoSparseDenseDoubleAr...
GediCore/src/gedi/core/data/reads/ReadCountMode.java
0.708213
0.441673
ReadCountMode.java
starcoder
package edu.kit.aifb.cumulus.datasource; import java.util.Iterator; import java.util.NoSuchElementException; /** * Booch utility for shared functions. * * @author <NAME> * @author <NAME> * @author <NAME> * @since 1.0 */ public abstract class LocalUtility { /** * Reorders <i>nodes</i>, an array in SPOC orde...
cumulusrdf-pluggable-storage/cumulusrdf-pluggable-storage-cassandra12x-hector-full-tp-index/src/main/java/edu/kit/aifb/cumulus/datasource/LocalUtility.java
0.859649
0.419291
LocalUtility.java
starcoder
public class Factory { /** * Getting two base var or val and create and expression. * * @param exp1 First expression. * @param exp2 Second expression. * @param exp expression type. * @return New expression. */ public static Expression getInstance(Expression exp1, E...
Factory.java
0.8488
0.612165
Factory.java
starcoder
package edu.duke.cs.jflap.automata.mealy; import edu.duke.cs.jflap.gui.environment.Universe; import edu.duke.cs.jflap.automata.State; import edu.duke.cs.jflap.automata.Transition; /** * A <code>MealyTransition</code> is a <code>Transition</code> * object with additional fields for the label and output. The * label...
jflaplib-core/src/main/java/edu/duke/cs/jflap/automata/mealy/MealyTransition.java
0.859561
0.448004
MealyTransition.java
starcoder
package com.opengamma.strata.loader.csv; import static com.opengamma.strata.loader.csv.CsvLoaderColumns.BUY_SELL_FIELD; import static com.opengamma.strata.loader.csv.CsvLoaderColumns.CONTRACT_SIZE_FIELD; import static com.opengamma.strata.loader.csv.CsvLoaderColumns.CURRENCY_FIELD; import static com.opengamma.strata.l...
modules/loader/src/main/java/com/opengamma/strata/loader/csv/GenericSecurityTradeCsvPlugin.java
0.777384
0.442396
GenericSecurityTradeCsvPlugin.java
starcoder
final class DoubleMap { //@ predicate valid(); DoubleMap() //@ requires obs(?O) &*& wait_level_below_obs(pair({DoubleMap.class}, 0r), O) == true; //@ ensures obs(O) &*& valid(); //@ terminates; { throw new RuntimeException(); } boolean containsKey(double key) //@ re...
examples/java/termination/SqrtCache.java
0.605799
0.443962
SqrtCache.java
starcoder
package edu.mines.jtk.util; /** * Pseudo-random float generator. Compared with the standard Java class * Random, this class generates generates random floats more quickly and * perhaps more randomly (certainly with greater periodicity). * * The uniform generator was * adapted from subroutine uni in "Numerical M...
core/src/main/java/edu/mines/jtk/util/RandomFloat.java
0.879794
0.458167
RandomFloat.java
starcoder
package com.example.application.data.entity; /* This class represents the average rating of a restaurant. The fields are the restaurant ID, the name of the restaurant, the sum of all ratings, the number of ratings it has, and the value of the average rating. The average rating is out of five "stars". This class is use...
src/main/java/com/example/application/data/entity/AverageRating.java
0.916232
0.505493
AverageRating.java
starcoder
public class Ex03 { public static void main(String[] args) { int N = Integer.parseInt(args[0]); double min = Double.parseDouble(args[1]) ; double max = Double.parseDouble(args[2]) ; // initialize canvas size and pen color in gray. StdDraw.setXscale(0, 1); StdDraw.setY...
algs4/ch01/section2exer/Ex03.java
0.567817
0.539711
Ex03.java
starcoder
package uk.theretiredprogrammer.nbpcglibrary.common; /** * A Set of Static methods which extends String processing functionality. * * @author <NAME> (richard at theretiredprogrammer.uk) */ public class StringX { /** * Pad a string to the given length with a defined padding char inserted to * the lef...
common/src/main/java/uk/theretiredprogrammer/nbpcglibrary/common/StringX.java
0.887241
0.463141
StringX.java
starcoder
package xyz.enhorse.commons.convert.datetime; import xyz.enhorse.commons.convert.Converters; import java.time.format.DateTimeFormatter; import java.util.Optional; /** * Conversion process from the type {@link T} * @param <T> the type to convert */ public class TemporalProcessor<T> { /** The value to convert...
src/main/java/xyz/enhorse/commons/convert/datetime/TemporalProcessor.java
0.910535
0.490846
TemporalProcessor.java
starcoder
package coyote.commons.codec; import java.io.UnsupportedEncodingException; import coyote.commons.StringUtil; /** * Converts hexadecimal Strings. * * <p>The charset used for certain operation can be set, the default is set in * {@link #DEFAULT_CHARSET_NAME} */ public class Hex implements BinaryEncoder, BinaryDeco...
src/main/java/coyote/commons/codec/Hex.java
0.933457
0.592549
Hex.java
starcoder
package org.md2k.mcerebrum.api.core.datakitapi.datatype.datapoint; import org.md2k.mcerebrum.api.core.datakitapi.TestingConstants; public class DataPointObjectMocker { /* This class creates an object with several primitive type fields to test DataPointObject. */ private static final long TEST_TI...
core/src/androidTest/java/org/md2k/mcerebrum/api/core/datakitapi/datatype/datapoint/DataPointObjectMocker.java
0.787809
0.620133
DataPointObjectMocker.java
starcoder
package com.github.sergdelft.sqlcorgi.schema; import net.sf.jsqlparser.expression.Alias; import net.sf.jsqlparser.statement.select.*; import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * This class represents the collection of tables that can be referenced from within a query. I...
src/main/java/com/github/sergdelft/sqlcorgi/schema/TableStructure.java
0.93992
0.520131
TableStructure.java
starcoder
package org.huangyr.project.vulcan.server.dag; import com.google.common.collect.Lists; import com.google.common.collect.Sets; import org.apache.commons.collections4.CollectionUtils; import java.util.*; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Consumer; import java.util.stream.Collec...
Vulcan_Server/src/main/java/org/huangyr/project/vulcan/server/dag/DAG.java
0.555918
0.506408
DAG.java
starcoder
package fr.univ_artois.lgi2a.similar.extendedkernel.simulationmodel; import java.util.List; import java.util.Map; import fr.univ_artois.lgi2a.similar.microkernel.ISimulationEngine; import fr.univ_artois.lgi2a.similar.microkernel.LevelIdentifier; import fr.univ_artois.lgi2a.similar.microkernel.SimulationTimeStamp; imp...
similar-extendedKernel/src/main/java/fr/univ_artois/lgi2a/similar/extendedkernel/simulationmodel/AbstractExtendedSimulationModel.java
0.851521
0.572693
AbstractExtendedSimulationModel.java
starcoder
package fr.isen.cir58.group6.minesweeper.view.console; import fr.isen.cir58.group6.minesweeper.model.Grid; import fr.isen.cir58.group6.minesweeper.model.Square; import java.util.ArrayList; import java.util.Observable; import java.util.Observer; import java.util.Arrays; /** * object that will display the Minesweeper ...
src/fr/isen/cir58/group6/minesweeper/view/console/ConsoleView.java
0.765856
0.41941
ConsoleView.java
starcoder
package models; import java.io.IOException; /** * Created by Adam on 2017-07-09. */ public class Queen extends Chessman { private static final Step s0 = new Step(1, 1); private static final Step s1 = new Step(2, 2); private static final Step s2 = new Step(3, 3); private static final Step s...
src/models/Queen.java
0.586168
0.693453
Queen.java
starcoder
package i2.act.examples.minic.frontend.ast; import i2.act.examples.minic.frontend.ast.visitors.ASTVisitor; import i2.act.examples.minic.frontend.info.SourcePosition; import i2.act.examples.minic.frontend.semantics.types.AtomicType; import i2.act.examples.minic.frontend.semantics.types.Type; public final class BinaryE...
src/main/java/i2/act/examples/minic/frontend/ast/BinaryExpression.java
0.772959
0.489259
BinaryExpression.java
starcoder
package ExamPreparation; import java.util.Map; import java.util.Scanner; import java.util.TreeMap; public class NeedforSpeed { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = Integer.parseInt(scanner.nextLine()); Map<String, Integer> distanceMap...
src/ExamPreparation/NeedforSpeed.java
0.63307
0.409457
NeedforSpeed.java
starcoder
package com.github.shuvava.search.bst; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; /** * class implements base functionality of node of BST * * <p>:Properties: * * <p>Each node x in the binary tree has a key key(x). Nodes other than the root have a parent p(x). * Nodes may have ...
search/src/main/java/com/github/shuvava/search/bst/BstNode.java
0.812496
0.443359
BstNode.java
starcoder
package frequent.medium; import utils.Pair; import java.util.*; /** * 1197. Minimum Knight Moves * * In an infinite chess board with coordinates from -infinity to +infinity, you have a knight at square [0, 0]. * * A knight has 8 possible moves it can make, as illustrated below. * Each move is two squares in a ...
src/main/java/frequent/medium/MinKnightMoves.java
0.912417
0.542984
MinKnightMoves.java
starcoder
package com.wwt.tools.basetools.graph; import com.wwt.tools.basetools.heap.MinHeap; import java.util.*; /** * Implementation of Dijkstra's algorithm for finding a shortest path between two nodes in a graph or * find the shortest path tree from a node to all other nodes. * Needs a MinHeap implementation on constru...
src/main/java/com/wwt/tools/basetools/graph/DijkstraAlgorithm.java
0.934088
0.540196
DijkstraAlgorithm.java
starcoder
package org.quiltmc.chasm.api; import java.util.Collection; import java.util.Collections; import java.util.Set; import org.quiltmc.chasm.api.tree.ListNode; /** * Bulk-instantiates {@link Transformation}s of classes. * * <p>{@link Transformer}s also provide a {@code String} ID for use in occasionally * hard-codin...
chasm/src/main/java/org/quiltmc/chasm/api/Transformer.java
0.9334
0.42937
Transformer.java
starcoder
package q1750; import org.junit.runner.RunWith; import util.runner.Answer; import util.runner.LeetCodeRunner; import util.runner.TestData; import util.runner.data.DataExpectation; /** * [Hard] 1707. Maximum XOR With an Element From Array * https://leetcode.com/problems/maximum-xor-with-an-element-from-array/ * * ...
src/main/java/q1750/Q1707_MaximumXorWithAnElementFromArray.java
0.863694
0.523359
Q1707_MaximumXorWithAnElementFromArray.java
starcoder
import java.util.*; import java.io.*; /** * Chapter 49C - Two-Dimensional Arrays Exercises 1-8 * * @author <NAME> * @version 1/29/15 * @author Period - 7 * @author Assignment - Ch49C_2DArrays * @author Sources - none */ public class Ch49C_2DArrays { Scanner scan; public Ch49C_2DArrays() { ...
workspace/Ch49C_2DArrays/Ch49C_2DArrays.java
0.772702
0.514278
Ch49C_2DArrays.java
starcoder
package baritone.pathing.movement; import baritone.api.utils.BetterBlockPos; import baritone.pathing.movement.movements.*; import baritone.utils.pathing.MutableMoveResult; import net.minecraft.util.EnumFacing; /** * An enum of all possible movements attached to all possible directions they could be taken in * * @a...
src/main/java/baritone/pathing/movement/Moves.java
0.840554
0.530845
Moves.java
starcoder
package pl.marcinchwedczuk.elfviewer.elfreader.utils; import java.util.Collection; import java.util.Objects; public abstract class BitFlags<T extends BitFlags<T>> { private final long raw; protected BitFlags(long init) { this.raw = init; } @SafeVarargs protected BitFlags(Flag<T>... flags...
elf-reader/src/main/java/pl/marcinchwedczuk/elfviewer/elfreader/utils/BitFlags.java
0.6705
0.401864
BitFlags.java
starcoder
package rectangularcartogram.measures; import ilog.cplex.IloCplex; import java.util.HashMap; import java.util.Map; import rectangularcartogram.data.graph.Edge; import rectangularcartogram.data.graph.Vertex; import rectangularcartogram.data.subdivision.Subdivision; import rectangularcartogram.data.subdivision.Subdivisi...
src/rectangularcartogram/measures/ResultingAngleDeviationMeasure.java
0.897505
0.457924
ResultingAngleDeviationMeasure.java
starcoder
package algorithms.graphs; import junit.framework.TestCase; /** * * @author nichole */ public class SimpleDAGTest extends TestCase { public SimpleDAGTest(String testName) { super(testName); } // constructing tests from MIT open courseware // network_optimization/MIT15_082JF10_av03.pdf ...
tests/algorithms/graphs/SimpleDAGTest.java
0.819857
0.45042
SimpleDAGTest.java
starcoder
package com.irurueta.navigation.inertial; import com.irurueta.units.Distance; import com.irurueta.units.DistanceConverter; import com.irurueta.units.DistanceUnit; import com.irurueta.units.Speed; import com.irurueta.units.SpeedConverter; import com.irurueta.units.SpeedUnit; import java.io.Serializable; import java.ut...
src/main/java/com/irurueta/navigation/inertial/INSTightlyCoupledKalmanConfig.java
0.941553
0.522141
INSTightlyCoupledKalmanConfig.java
starcoder
package leetcode.sept; import java.util.*; public class day29 { public class TreeNode { int val; TreeNode left; TreeNode right; TreeNode() { } TreeNode(int val) { this.val = val; } TreeNode(int val, TreeNode left, TreeNode right) { ...
src/leetcode/sept/day29.java
0.866965
0.446796
day29.java
starcoder
package com.bluegosling.possible; import static com.bluegosling.function.Predicates.alwaysAccept; import static com.bluegosling.function.Predicates.alwaysReject; import static com.bluegosling.testing.MoreAsserts.assertThrows; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; imp...
test/com/bluegosling/possible/AbstractPossibleTest.java
0.909581
0.518851
AbstractPossibleTest.java
starcoder