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 cl.uchile.dcc.scrabble.gui.types;
import cl.uchile.dcc.scrabble.gui.memory.FlyweightNull;
import cl.uchile.dcc.scrabble.gui.memory.FlyweightTString;
/**
* Class that represents every type for Scrabble
*/
public abstract class Types implements ITypes{
/**
* Since any subclass can be transformed to ... | src/main/java/cl/uchile/dcc/scrabble/gui/types/Types.java | 0.922185 | 0.472623 | Types.java | starcoder |
package com.fishercoder.solutions;
import com.fishercoder.common.classes.TreeNode;
import java.util.HashMap;
import java.util.Map;
public class _106 {
public static class Solution1 {
/**
* https://discuss.leetcode.com/topic/3296/my-recursive-java-code-with-o-n-time-and-o-n-space
* Note... | src/main/java/com/fishercoder/solutions/_106.java | 0.877214 | 0.458227 | _106.java | starcoder |
package com.rc.clustering;
import java.util.ArrayList;
import java.util.List;
public abstract class Cluster {
/**
* List of points assigned to this cluster
*/
protected List<Point> pointList;
/**
* Dimensionality of the data, the number of variables
*/
... | src/main/java/com/rc/clustering/Cluster.java | 0.920119 | 0.492554 | Cluster.java | starcoder |
import org.junit.Test;
import static org.junit.Assert.*;
import common.LinkedListNode;
/**
* Cracking the Coding Interview(5ed) Problem 2.5:
* You have two numbers represented by a linked list, where each node contains
* a single digit. The digits are stored in reverse order, such that the 1's
* digit is at the h... | ctci/linkedlist/ReversedListSum.java | 0.810591 | 0.568476 | ReversedListSum.java | starcoder |
package com.github.paganini2008.devtools;
/**
*
* Comparables
*
* @author <NAME>
*
* @since 2.0.1
*/
public abstract class Comparables {
public static <T> T nullOrMax(T leftValue, T rightValue) {
return leftValue == null ? rightValue : leftValue;
}
public static <T> T nullOrMin(T leftValue, T rightValu... | devtools-lang/src/main/java/com/github/paganini2008/devtools/Comparables.java | 0.885545 | 0.477615 | Comparables.java | starcoder |
package collections.maps.hashing;
public class Hashing {
/*
* if searching an array wich is not sorted
* might need to examine all the elements
*
* what if we have a function that will tell
* the index of the searched value
*
* this function is a hash function
*
* we h... | src/collections/maps/hashing/Hashing.java | 0.846863 | 0.49231 | Hashing.java | starcoder |
package triangle.geometry;
import java.util.ArrayList;
import java.util.List;
/**
* A polygon represented as a planar straight line graph.
*/
public class Polygon implements IPolygon {
List<Vertex> points;
List<Point> holes;
List<RegionPointer> regions;
List<ISegment> segments;
boolean pointMa... | src/triangle/geometry/Polygon.java | 0.957794 | 0.504333 | Polygon.java | starcoder |
package benchmarks.flow.scrabble;
import java.util.*;
import java.util.Map.Entry;
import java.util.concurrent.TimeUnit;
import hu.akarnokd.rxjava2.math.MathFlowable;
import org.openjdk.jmh.annotations.*;
import benchmarks.flow.scrabble.optimizations.*;
import io.reactivex.*;
import io.reactivex.functions.Function;
/... | benchmarks/src/jmh/java/benchmarks/flow/scrabble/RxJava2PlaysScrabbleOpt.java | 0.798933 | 0.402099 | RxJava2PlaysScrabbleOpt.java | starcoder |
package ai.djl.nn.recurrent;
import ai.djl.Device;
import ai.djl.ndarray.NDArray;
import ai.djl.ndarray.NDList;
import ai.djl.ndarray.internal.NDArrayEx;
import ai.djl.ndarray.types.Shape;
import ai.djl.nn.Block;
import ai.djl.nn.Parameter;
import ai.djl.training.ParameterStore;
import ai.djl.util.PairList;
import ai.... | api/src/main/java/ai/djl/nn/recurrent/LSTM.java | 0.874023 | 0.425128 | LSTM.java | starcoder |
package org.jfree.data.statistics;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
/**
* A utility class that provides some simple statistical functions.
*/
public abstract class Statistics {
/**
* Returns the mean of... | src/org/jfree/data/statistics/Statistics.java | 0.910247 | 0.569075 | Statistics.java | starcoder |
package org.archive.util;
import java.io.Serializable;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.security.SecureRandom;
import java.util.Random;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.hash.Funnels;
import com.google.common.primitives.Ints;
... | commons/src/main/java/org/archive/util/BloomFilter64bit.java | 0.946868 | 0.551815 | BloomFilter64bit.java | starcoder |
package fr.xebia.filter;
import fr.xebia.export.BufferedImageExporter;
import org.jtransforms.fft.DoubleFFT_2D;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.nio.file.Path;
import java.nio.file.Paths;
public class ImageFrequencyFilter implements TriPredicate<BufferedImage, Path, Integer> {
... | src/main/java/fr/xebia/filter/ImageFrequencyFilter.java | 0.860691 | 0.496887 | ImageFrequencyFilter.java | starcoder |
* Modified by the Sable Research Group and others 1997-1999.
* See the 'credits' file distributed with Soot for the complete list of
* contributors. (Soot is distributed at http://www.sable.mcgill.ca/soot)
*/
package soot.jimple.toolkits.scalar.pre;
import soot.options.*;
import soot.jimple.toolkits.graph.*;
i... | Core/soot/src/main/java/soot/jimple/toolkits/scalar/pre/LazyCodeMotion.java | 0.589835 | 0.42674 | LazyCodeMotion.java | starcoder |
package com.feedzai.openml.provider.descriptor;
import com.google.common.base.MoreObjects;
import com.google.common.base.Preconditions;
import java.util.Objects;
import java.net.URL;
import java.util.Set;
/**
* A class that serves the purpose of describing a Machine Learning algorithm and its configuration
* param... | openml-api/src/main/java/com/feedzai/openml/provider/descriptor/MLAlgorithmDescriptor.java | 0.944267 | 0.532547 | MLAlgorithmDescriptor.java | starcoder |
package org.apache.atlas.query.antlr4;
import org.antlr.v4.runtime.tree.ParseTreeVisitor;
/**
* This interface defines a complete generic visitor for a parse tree produced
* by {@link AtlasDSLParser}.
*
* @param <T> The return type of the visit operation. Use {@link Void} for
* operations with no return type.
*/... | repository/src/main/java/org/apache/atlas/query/antlr4/AtlasDSLParserVisitor.java | 0.88485 | 0.403391 | AtlasDSLParserVisitor.java | starcoder |
// ***** problem statement *****
/*
Design a data structure that follows the constraints of a Least Recently Used (LRU) cache.
Implement the LRUCache class:
LRUCache(int capacity) Initialize the LRU cache with positive size capacity.
int get(int key) Return the value of the key if the key exists, otherwise return -1... | LeetCodeSolutions/src/main/java/LRUCache.java | 0.526343 | 0.488649 | LRUCache.java | starcoder |
package noobanidus.libs.noobutil.util;
import net.minecraft.util.Direction;
import net.minecraft.util.Rotation;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.shapes.IBooleanFunction;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.util.math.shapes.VoxelShapes;
impo... | src/main/java/noobanidus/libs/noobutil/util/VoxelUtil.java | 0.917994 | 0.525734 | VoxelUtil.java | starcoder |
package nl.tudelft.processing;
import nl.tudelft.parser.TermsOccurrences;
import java.util.ArrayList;
import java.util.List;
public class SmellinessMetricAtTestCaseLevel {
/**
* Computes the LCTM (Lack of Cohesion of a Test Method) as the average similarity between its
* constituent methods
* @param methods ... | source/client/src/main/java/nl/tudelft/processing/SmellinessMetricAtTestCaseLevel.java | 0.757077 | 0.414425 | SmellinessMetricAtTestCaseLevel.java | starcoder |
package com.google.common.graph;
import com.google.common.annotations.Beta;
import com.google.errorprone.annotations.CanIgnoreReturnValue;
/**
* A subtype of {@link Network} which permits mutations.
* Users should generally use the {@link Network} interface where possible.
*
* @author <NAME>
* @param <N> Node pa... | guava/src/com/google/common/graph/MutableNetwork.java | 0.939962 | 0.40751 | MutableNetwork.java | starcoder |
package org.apache.flink.ml.linalg;
import org.apache.flink.util.Preconditions;
/** A utility class that provides BLAS routines over matrices and vectors. */
public class BLAS {
/** For level-1 function dspmv, use javaBLAS for better performance. */
private static final dev.ludovic.netlib.BLAS JAVA_BLAS =
... | flink-ml-core/src/main/java/org/apache/flink/ml/linalg/BLAS.java | 0.912908 | 0.672271 | BLAS.java | starcoder |
package org.springframework.aot.hint;
import java.lang.reflect.Constructor;
import java.lang.reflect.Executable;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import org.springframework.util.ObjectUtils;
/**
* A hint that descr... | spring-core/src/main/java/org/springframework/aot/hint/ExecutableHint.java | 0.888638 | 0.417271 | ExecutableHint.java | starcoder |
package org.bytedeco.tensorrt.nvinfer;
import java.nio.*;
import org.bytedeco.javacpp.*;
import org.bytedeco.javacpp.annotation.*;
import static org.bytedeco.javacpp.presets.javacpp.*;
import org.bytedeco.cuda.cudart.*;
import static org.bytedeco.cuda.global.cudart.*;
import org.bytedeco.cuda.cublas.*;
import static... | tensorrt/src/gen/java/org/bytedeco/tensorrt/nvinfer/IGatherLayer.java | 0.776792 | 0.410756 | IGatherLayer.java | starcoder |
package com.opengamma.financial.analytics.model.equity.option;
import java.util.Collections;
import java.util.Map;
import java.util.Set;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.opengamma.analytics.financial.equity.EqyOptBjerksundStenslandPresentValueCalculator;
import com.opengamma.analyt... | projects/financial/src/main/java/com/opengamma/financial/analytics/model/equity/option/EquityOptionBjerksundStenslandScenarioPnLFunction.java | 0.882662 | 0.459379 | EquityOptionBjerksundStenslandScenarioPnLFunction.java | starcoder |
package goodman.java.sql;
import goodman.java.io.Reader;
import goodman.java.sql.*;
/**
* The mapping in the Java™ programming language
* for the SQL <code>CLOB</code> type.
* An SQL <code>CLOB</code> is a built-in type
* that stores a Character Large Object as a column value in a row of
* a database table... | source_code/src/goodman/java/sql/Clob.java | 0.914915 | 0.484136 | Clob.java | starcoder |
package com.opengamma.analytics.financial.model.option.pricing.analytic;
import org.apache.commons.lang.Validate;
import com.opengamma.analytics.financial.model.option.definition.CappedPowerOptionDefinition;
import com.opengamma.analytics.financial.model.option.definition.StandardOptionDataBundle;
import com.opengamm... | projects/analytics/src/main/java/com/opengamma/analytics/financial/model/option/pricing/analytic/CappedPowerOptionModel.java | 0.915727 | 0.577555 | CappedPowerOptionModel.java | starcoder |
package com.terraformersmc.shapes.api;
import net.minecraft.util.math.BlockPos;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.IntStream;
import java.util.stream.Stream;
/**
* @author <Wtoll> <NAME> on 2020-06-07
* @project Shapes
*/
public interface Position {... | src/main/java/com/terraformersmc/shapes/api/Position.java | 0.882269 | 0.446253 | Position.java | starcoder |
package com.opengamma.analytics.financial.model.volatility;
import org.apache.commons.lang.ObjectUtils;
import org.apache.commons.lang.Validate;
import com.opengamma.analytics.math.function.Function1D;
import com.opengamma.analytics.math.rootfinding.NewtonRaphsonSingleRootFinder;
import com.opengamma.util.CompareUtil... | src/com/opengamma/analytics/financial/model/volatility/BlackFormula.java | 0.895114 | 0.547283 | BlackFormula.java | starcoder |
package us.ihmc.euclid.exceptions;
import us.ihmc.euclid.matrix.interfaces.Matrix3DReadOnly;
import us.ihmc.euclid.tools.EuclidCoreIOTools;
/**
* {@code RuntimeException} dedicated to operations where a matrix needs to be inverted. Typically,
* this corresponds to when a matrix is singular, i.e. its determinant is ... | src/us/ihmc/euclid/exceptions/SingularMatrixException.java | 0.958226 | 0.647408 | SingularMatrixException.java | starcoder |
package de.bluecolored.bluemap.common.rendermanager;
import com.flowpowered.math.vector.Vector2i;
import com.flowpowered.math.vector.Vector2l;
import de.bluecolored.bluemap.core.debug.DebugDump;
import de.bluecolored.bluemap.core.map.BmMap;
import de.bluecolored.bluemap.core.world.Grid;
import de.bluecolored.bluemap.c... | BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/rendermanager/WorldRegionRenderTask.java | 0.833697 | 0.592784 | WorldRegionRenderTask.java | starcoder |
package com.scurrilous.circe.params;
import com.scurrilous.circe.HashParameters;
/**
* Hash parameters used to define a <a
* href="http://en.wikipedia.org/wiki/Cyclic_redundancy_check">cyclic redundancy
* check</a> (CRC). Includes some commonly used sets of parameters.
*/
public class CrcParameters implements Has... | bookkeeper/circe-checksum/src/main/java/com/scurrilous/circe/params/CrcParameters.java | 0.937662 | 0.548855 | CrcParameters.java | starcoder |
package org.tensorflow.lite.support.model;
import static com.google.common.truth.Truth.assertThat;
import static org.junit.Assert.fail;
import android.content.Context;
import androidx.test.core.app.ApplicationProvider;
import java.io.IOException;
import java.nio.MappedByteBuffer;
import java.util.HashMap;
import java... | tensorflow_lite_support/java/src/javatests/org/tensorflow/lite/support/model/ModelTest.java | 0.902867 | 0.447581 | ModelTest.java | starcoder |
package qub;
public interface TestResourcesTests
{
static void test(TestRunner runner)
{
runner.testGroup(TestResources.class, () ->
{
runner.testGroup("create(DesktopProcess)", () ->
{
runner.test("with null", (Test test) ->
{
... | tests/qub/TestResourcesTests.java | 0.547706 | 0.498169 | TestResourcesTests.java | starcoder |
package com.jking31cs.matrix;
import com.jking31cs.vector.Vector3D;
import java.util.Objects;
/**
* 3D Matrix along with basic operations.
*/
public class Matrix3D {
public static final Matrix3D I = new Matrix3D(
1,0,0,
0,1,0,
0,0,1
);
public final float
... | src/main/java/com/jking31cs/matrix/Matrix3D.java | 0.856287 | 0.542379 | Matrix3D.java | starcoder |
package org.tomitribe.churchkey.pem;
import org.tomitribe.churchkey.asn1.Asn1Object;
import org.tomitribe.churchkey.asn1.DerParser;
import org.tomitribe.churchkey.asn1.Oid;
import org.tomitribe.churchkey.ec.EcPoints;
import java.io.IOException;
import java.math.BigInteger;
import java.security.spec.ECField;
import ja... | src/main/java/org/tomitribe/churchkey/pem/EcCurveParams.java | 0.808105 | 0.429609 | EcCurveParams.java | starcoder |
package org.apache.commons.math.distribution;
import java.io.Serializable;
import org.apache.commons.math.MathException;
import org.apache.commons.math.MathRuntimeException;
import org.apache.commons.math.special.Beta;
/**
* Default implementation of
* {@link org.apache.commons.math.distribution.FDistribution}.
*... | examples/math_70/src/main/java/org/apache/commons/math/distribution/FDistributionImpl.java | 0.967333 | 0.483526 | FDistributionImpl.java | starcoder |
package deformablemesh.geometry;
import deformablemesh.DeformableMesh3DTools;
import deformablemesh.meshview.MeshFrame3D;
import java.awt.Color;
import java.util.Arrays;
/**
* Creates a 'shell' mesh, which is essentially the original mesh + a mesh created by
* shifting the nodes along the normal at the node a smal... | src/main/java/deformablemesh/geometry/ShellMesh.java | 0.672439 | 0.547343 | ShellMesh.java | starcoder |
package simple.actor;
import net.jcip.annotations.GuardedBy;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.concurrent.Executor;
import static simple.actor.Checks.checkNotNull;
/**
* A group of {@link Actor Actors} which use a common {@link Runner} to {@link ... | core/src/main/java/simple/actor/System.java | 0.912998 | 0.40436 | System.java | starcoder |
package dalvik.system;
/**
* Provides a simple {@link ClassLoader} implementation that operates on a list
* of files and directories in the local file system, but does not attempt to
* load classes from the network. Android uses this class for its system class
* loader and for its application class loader(s).
*/
p... | AndroidCompat/src/main/java/dalvik/system/PathClassLoader.java | 0.871324 | 0.403861 | PathClassLoader.java | starcoder |
import java.util.Random;
// Assume rows x cols or m x n rectangular 2D matrix
class Random2DMatrix {
private static void checkInputs(int rows, int cols) {
if (rows < 0 || cols < 0) {
throw new IllegalArgumentException();
}
}
public static void printMatrix(boolean[][] mat) {
... | problems/dynamic-programming/Random2DMatrix.java | 0.699562 | 0.598342 | Random2DMatrix.java | starcoder |
package graphql;
import graphql.language.BooleanValue;
import graphql.language.FloatValue;
import graphql.language.IntValue;
import graphql.language.StringValue;
import graphql.schema.Coercing;
import graphql.schema.CoercingParseLiteralException;
import graphql.schema.CoercingParseValueException;
import graphql.schem... | src/main/java/graphql/Scalars.java | 0.827724 | 0.430686 | Scalars.java | starcoder |
package com.redhat.ceylon.compiler.typechecker.model;
import static com.redhat.ceylon.compiler.typechecker.model.Util.arguments;
import java.util.List;
/**
* Anything which includes a type declaration:
* a method, attribute, parameter, or local.
*
* @author <NAME>
*/
public abstract class TypedDeclaration exte... | src/com/redhat/ceylon/compiler/typechecker/model/TypedDeclaration.java | 0.764804 | 0.414721 | TypedDeclaration.java | starcoder |
public class BoruvkasAlgorithm {
public void boruvkaMST(Graph graph) {
//Getting data of given Graph
int vertNum = graph.getVertNum();
int edgeNum = graph.getEdgeNum();
String[] vertNames = graph.getVertNames();
Edge[] edges = graph.getEdges();
Subset[] subsets = n... | src/BoruvkasAlgorithm.java | 0.503906 | 0.503662 | BoruvkasAlgorithm.java | starcoder |
package org.apache.flink.runtime.topology;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.apache.flink.core.io.IOReadableWritable;
import org.apache.flink.core.io.StringRecord;
import org.apache.flink.core.memory.DataInputView;
import org.apache.fl... | flink-runtime/src/main/java/org/apache/flink/runtime/topology/NetworkNode.java | 0.7641 | 0.4165 | NetworkNode.java | starcoder |
package org.elasticsearch.painless.symbol;
import org.elasticsearch.painless.FunctionRef;
import org.elasticsearch.painless.Operation;
import org.elasticsearch.painless.ir.IRNode.IRCondition;
import org.elasticsearch.painless.ir.IRNode.IRDecoration;
import org.elasticsearch.painless.lookup.PainlessCast;
import org.ela... | modules/lang-painless/src/main/java/org/elasticsearch/painless/symbol/IRDecorations.java | 0.904276 | 0.426799 | IRDecorations.java | starcoder |
package com.sleepycat.je.utilint;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Formatter;
import java.util.logging.Handler;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.sleepycat.je... | code/third_party/bdb/src/com/sleepycat/je/utilint/LoggerUtils.java | 0.669529 | 0.435661 | LoggerUtils.java | starcoder |
package io.github.opencubicchunks.cubicchunks.world;
import io.github.opencubicchunks.cubicchunks.CubicChunks;
import mcp.MethodsReturnNonnullByDefault;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import javax.annotation.Nullable;
import javax.annotation.ParametersAreNonnullByDefault;
... | src/main/java/io/github/opencubicchunks/cubicchunks/world/SpawnPlaceFinder.java | 0.586286 | 0.433862 | SpawnPlaceFinder.java | starcoder |
package co.edu.uniandes.baco.restaurante.ejb;
import co.edu.uniandes.baco.restaurante.entities.DomicilioEntity;
import co.edu.uniandes.baco.restaurante.exceptions.BusinessLogicException;
import co.edu.uniandes.baco.restaurante.persistence.DomicilioPersistence;
import java.util.List;
import java.util.logging.Level;... | restaurante-back/src/main/java/co/edu/uniandes/baco/restaurante/ejb/DomicilioLogic.java | 0.639624 | 0.405272 | DomicilioLogic.java | starcoder |
package com.Whodundid.core.util.storageUtil;
import net.minecraft.util.BlockPos;
import net.minecraft.util.Vec3;
import net.minecraft.util.Vec3i;
//Author: <NAME>
/**
* The {@code Vector3D} class is a data type containing three individual {@code Double} values: x, y, and z.
* The {@code Vector3D} class provides nu... | src/main/java/com/Whodundid/core/util/storageUtil/Vector3D.java | 0.935472 | 0.745004 | Vector3D.java | starcoder |
package com.spartronics4915.lib.math.threedim.math3;
import org.apache.commons.math3.linear.Array2DRowRealMatrix;
import org.apache.commons.math3.geometry.euclidean.threed.Vector3D;
/* Vec3 is a thin vaneer atop Vector3D. Its sole purpose
* is to make clients of this library not have to worry about
* importing. We... | src/main/java/com/spartronics4915/lib/math/threedim/math3/Vec3.java | 0.921653 | 0.653645 | Vec3.java | starcoder |
public class Elements {
//format: element symbol, element name, atomic number, molar mass
public static String[][] elements = new String[][] {
{"H", "Hydrogen", "1", "1.008"},
{"He", "Helium", "2", "4.0026"},
{"Li", "Lithium", "3", "6.94"},
{"Be", "Berylli... | source/Elements.java | 0.509032 | 0.501343 | Elements.java | starcoder |
package org.broadinstitute.hellbender.tools.copynumber.utils.annotatedinterval;
import com.google.common.collect.Sets;
import htsjdk.samtools.SAMSequenceDictionary;
import htsjdk.samtools.util.Locatable;
import htsjdk.samtools.util.PeekableIterator;
import org.apache.commons.lang3.StringUtils;
import org.broadinstitut... | src/main/java/org/broadinstitute/hellbender/tools/copynumber/utils/annotatedinterval/AnnotatedIntervalUtils.java | 0.928417 | 0.466116 | AnnotatedIntervalUtils.java | starcoder |
package org.moeaframework.problem.WFG;
import org.junit.Test;
import org.moeaframework.core.Problem;
import org.moeaframework.problem.ProblemTest;
public class WFGTest extends ProblemTest {
@Test
public void testWFG1_2D() throws Exception {
test("WFG1", 2);
}
@Test
public void testWFG1_3D() thr... | test/org/moeaframework/problem/WFG/WFGTest.java | 0.667906 | 0.558267 | WFGTest.java | starcoder |
package graph;
import java.util.*;
public class Graph {
Set<Vertex> vertexes = new HashSet<>();
List<Edge> edges = new ArrayList<>();
public Graph() {
}
public Vertex addVertex(Object value){
System.out.println("addVortex with value = " + value);
Vertex newVertex = new Vertex(val... | challenge/graph/app/src/main/java/graph/Graph.java | 0.840128 | 0.611034 | Graph.java | starcoder |
package com.example.guitar_tutor.tuner.detection;
import com.example.guitar_tutor.tuner.config.AudioConfig;
/**
* A {@link PitchDetector} implementation that uses a YIN algorithm to determine the frequency of
* the provided waveform data. The YIN algorithm is similar to the Auto-correlation Function used
* for pit... | app/src/main/java/com/example/guitar_tutor/tuner/detection/YINPitchDetector.java | 0.955309 | 0.732807 | YINPitchDetector.java | starcoder |
package com.mopub.volley;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.TreeMap;
public class NetworkResponse {
public final List<Header> allHeaders;
public final byte[] data;
public final Map<String, Str... | sources/com/mopub/volley/NetworkResponse.java | 0.719088 | 0.416322 | NetworkResponse.java | starcoder |
package com.projecttango.tangoutils.renderables;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.FloatBuffer;
import android.opengl.GLES20;
import android.opengl.Matrix;
/**
* {@link Renderable} OpenGL object showing the 'floor' of the current scene.
* This is a static grid placed in the sce... | PointCloudJava/tangoUtils/src/main/java/com/projecttango/tangoutils/renderables/Grid.java | 0.937819 | 0.522933 | Grid.java | starcoder |
package org.openstreetmap.atlas.checks.validation.tag;
import java.util.ArrayDeque;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Optional;
import org.openstreetmap.atlas.checks.base.BaseCheck;
import org.openstreetmap.atlas.checks.flag.CheckFlag;
import org.openstreetmap.... | src/main/java/org/openstreetmap/atlas/checks/validation/tag/InvalidLanesTagCheck.java | 0.893501 | 0.415314 | InvalidLanesTagCheck.java | starcoder |
package com.raspoid.additionalcomponents.camera.opencv;
import java.util.Date;
import org.opencv.core.Core;
import org.opencv.core.Mat;
import org.opencv.core.MatOfRect;
import org.opencv.core.Point;
import org.opencv.core.Rect;
import org.opencv.core.Scalar;
import org.opencv.highgui.Highgui;
import org.opencv.objde... | src/main/java/com/raspoid/additionalcomponents/camera/opencv/FaceDetector.java | 0.907944 | 0.416619 | FaceDetector.java | starcoder |
package org.datalift.fwk.rdf;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* Helper class to ease logging of SPARQL queries by providing a
* {@link #toString() shortened description} of the query text,
* without namespace prefixes declarations and a possibly truncated
* query body.
*
* ... | framework/src/java/org/datalift/fwk/rdf/QueryDescription.java | 0.950099 | 0.442275 | QueryDescription.java | starcoder |
package com.example.eddiesyn.myfirst_app;
import java.util.ArrayList;
/**
* Data is a class designed to transfer a set of data points from various sources in a standardized way. The class is used by
* the {@link DataProvider} class to transfer its data.
* <p>
* The getters return {@link ArrayList}s of actual data... | Group1_final/Myfirst_app/app/src/main/java/com/example/eddiesyn/myfirst_app/Data.java | 0.920767 | 0.649398 | Data.java | starcoder |
package android.support.v4.graphics.drawable;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapShader;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Rect;
imp... | jadx-cli/app-release/sources/android/support/v4/graphics/drawable/RoundedBitmapDrawable.java | 0.880077 | 0.423339 | RoundedBitmapDrawable.java | starcoder |
package org.orekit.models.earth.tessellation;
import org.hipparchus.geometry.euclidean.threed.Vector3D;
import org.orekit.bodies.GeodeticPoint;
import org.orekit.models.earth.tessellation.TileAiming;
import java.util.List;
public class PythonTileAiming implements TileAiming {
/** Part of JCC Python interface t... | src/main/java/org/orekit/models/earth/tessellation/PythonTileAiming.java | 0.873161 | 0.464902 | PythonTileAiming.java | starcoder |
package huyang.edu.cn.mr.iterations;
import huyang.edu.cn.Job;
import huyang.edu.cn.Utils.TwordsComparable;
import huyang.edu.cn.Utils.Util;
import huyang.edu.cn.mr.data.MatrixKind;
import huyang.edu.cn.mr.data.indexToCountWritable;
import huyang.edu.cn.mr.data.twoDimensionIndexWritable;
import huyang.edu.cn.vector.Pa... | src/main/java/huyang/edu/cn/mr/iterations/CalParamsReducer.java | 0.669529 | 0.458894 | CalParamsReducer.java | starcoder |
package solidus.zkproofs;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.math.BigInteger;
import java.util.List;
import java.util.Objects;
import org.bouncycastle.crypto.ec.ECPair;
import org.bouncycastle.math.ec.ECPoint;
import com.google.common.collect.ImmutableLis... | src/solidus/zkproofs/DoubleSwapProof.java | 0.945714 | 0.444746 | DoubleSwapProof.java | starcoder |
package com.auth.utils;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* @author Alonso --- <EMAIL>
*/
public class U... | src/main/java/com/auth/utils/UtilsDate.java | 0.720663 | 0.425665 | UtilsDate.java | starcoder |
package edu.wpi.first.wpilibj.templates;
/**
* 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.
*/
publi... | src/edu/wpi/first/wpilibj/templates/RobotMap.java | 0.658527 | 0.520314 | RobotMap.java | starcoder |
package org.ddogleg.nn.alg.searches;
import org.ddogleg.nn.alg.KdTree;
import org.ddogleg.nn.alg.KdTreeSearch1;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
/**
* Standard tests for implemntations of {@link KdTreeSearch1}.
*
* @author <NAME>
*/
public abstract class Standa... | test/org/ddogleg/nn/alg/searches/StandardKdTreeSearch1Tests.java | 0.893861 | 0.528777 | StandardKdTreeSearch1Tests.java | starcoder |
package it.gualtierotesta.playwithjava.kata;
import java.util.Arrays;
import java.util.stream.IntStream;
/*
The new "Avengers" movie has just been released! There are a lot of people at the cinema box office
standing in a huge line. Each of them has a single 100, 50 or 25 dollars bill. An "Avengers"
ticket costs 25 d... | misc/src/main/java/it/gualtierotesta/playwithjava/kata/VasyaClerk.java | 0.591841 | 0.462534 | VasyaClerk.java | starcoder |
package org.jetbrains.skija;
import lombok.Data;
import org.jetbrains.annotations.*;
/**
* <p>Matrix holds a 3x3 matrix for transforming coordinates. This allows mapping
* Point and vectors with translation, scaling, skewing, rotation, and
* perspective.</p>
*
* <p>Matrix includes a hidden variable that c... | shared/src/main/java/org/jetbrains/skija/Matrix33.java | 0.942962 | 0.740033 | Matrix33.java | starcoder |
package LBJ2.util;
import java.util.Arrays;
import LBJ2.classify.Feature;
/**
* This class implements an expandable array of features that should be
* faster than java's <code>Vector</code>.
*
* @author <NAME>
**/
public class FVector implements Cloneable, java.io.Serializable
{
/** The default capacity o... | src/main/java/LBJ2/util/FVector.java | 0.895634 | 0.701074 | FVector.java | starcoder |
package org.pdfsam.eventstudio;
/**
* An {@link EventStudio} is a thread-safe central place allowing broadcast of events to {@link Listener}s to registered on a Station. Stations are created internally as soon as a
* listener is added but it's up to the user to clear a station when it's not needed anymore. {@link L... | src/main/java/org/pdfsam/eventstudio/EventStudio.java | 0.91442 | 0.532364 | EventStudio.java | starcoder |
package org.andengine.c.d;
import org.andengine.c.c.c;
import org.andengine.opengl.b.g;
import org.andengine.opengl.c.c.b;
import org.andengine.opengl.d.a.d;
import org.andengine.opengl.d.e;
public class a extends c {
public static final org.andengine.opengl.d.a.c g = new d(3).a(0, "a_position", 2, 5126, false).a... | APK/flappybirds/sources/org/andengine/c/d/a.java | 0.711631 | 0.494202 | a.java | starcoder |
package controller;
import model.*;
import model.board.Board;
import model.board.Position;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
/**
* Handles the game logic for the Cluedo game
* access and updates the models for the view
*
* @author braithdani... | Undergraduate/SWEN222/swen222-cludo/Cluedo/src/controller/Controller.java | 0.839142 | 0.420421 | Controller.java | starcoder |
package com.googlecode.totallylazy.collections;
import com.googlecode.totallylazy.Atomic;
import com.googlecode.totallylazy.Maps;
import com.googlecode.totallylazy.Option;
import com.googlecode.totallylazy.Pair;
import com.googlecode.totallylazy.Segment;
import com.googlecode.totallylazy.Unchecked;
import java.util.C... | ir/src/com/googlecode/totallylazy/collections/AtomicMap.java | 0.75392 | 0.400456 | AtomicMap.java | starcoder |
package com.dknacht.crcitu;
/**
* Class for the 16 bits CRC-ITU calculation.
*
* Contains all related functions and predefined variables formaking the
* calculation. Based on the CRC-ITU especifications, the CRC npm implementation
* and the crc-itu2py code by mrudang-vora.
*
* @see https://gist.github.com/mruda... | src/com/dknacht/crcitu/CRCITU.java | 0.71103 | 0.455925 | CRCITU.java | starcoder |
package org.direct_bt;
import java.util.List;
/**
* BTAdapter represents one local Bluetooth Controller.
* <p>
* @anchor BTAdapterRoles
* Local BTAdapter roles (see {@link #getRole()}):
*
* - {@link BTRole::Master}: The local adapter is discovering remote {@link BTRole::Slave} {@link BTDevice}s and may in... | java/org/direct_bt/BTAdapter.java | 0.857231 | 0.507263 | BTAdapter.java | starcoder |
package com.initializr.config;
/**
* Enum Singleton to define the configurable parameters in the application.
*
* <p>All configurations which are meant to be changeable during runtime should be defined here.</p>
* @author <NAME>
*/
public enum Configuration {
/**
* Singleton instance of {@link Configur... | src/main/java/com/initializr/config/Configuration.java | 0.912551 | 0.419053 | Configuration.java | starcoder |
package net.minecraft.server;
public class PacketPlayOutAbilities extends Packet {
private boolean a;
private boolean b;
private boolean c;
private boolean d;
private float e;
private float f;
public PacketPlayOutAbilities() {}
public PacketPlayOutAbilities(PlayerAbilities playerabil... | libs/craftbukkit/src/main/java/net/minecraft/server/PacketPlayOutAbilities.java | 0.829803 | 0.428473 | PacketPlayOutAbilities.java | starcoder |
package modelo.generarReporte;
import modelo.persistencia.Jugador;
public class Reporte {
private String resultado_burpee;
private String resultado_cooper;
private String resultado_elasticidad;
private String resultado_fuerzaBrazos;
private String resultado_ruffier;
private String resultado_s... | src/java/modelo/generarReporte/Reporte.java | 0.639286 | 0.474083 | Reporte.java | starcoder |
package distance.elastic;
import java.util.Random;
import core.contracts.Dataset;
/**
* Some classes in this package may contain borrowed code from the timeseriesweka project (Bagnall, 2017),
* we might have modified (bug fixes, and improvements for efficiency) the original classes.
*
*/
public class WDTW {
... | experiments/2021-04-19-PF2018-comparison/PF2018_java/ProximityForest/src/distance/elastic/WDTW.java | 0.556641 | 0.506897 | WDTW.java | starcoder |
package io.inbot.utils;
import com.google.common.collect.Streams;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* Simple implementation of a Trie that may be used to... | src/main/java/io/inbot/utils/SimpleStringTrie.java | 0.918727 | 0.420659 | SimpleStringTrie.java | starcoder |
* The code and scripts in this package demonstrate some of the basic functions
* of the Oracle NoSQL Database table API, including creation and use of
* secondary indexes.
* The examples are independent of one another and have no dependencies.
*
* <h3>Before Running the Table Examples</h3>
* <h4>Start a Store</h... | src/main/java/examples/table/package-info.java | 0.665302 | 0.643469 | package-info.java | starcoder |
import java.util.ArrayList;
public class BruteCollinearPoints {
private Point[] points;
private ArrayList<LineSegment> segments;
public BruteCollinearPoints(Point[] points) {
if (points == null) {
throw new java.lang.IllegalArgumentException(
"Input to BruteCollinea... | Collinear/BruteCollinearPoints.java | 0.762336 | 0.400134 | BruteCollinearPoints.java | starcoder |
import java.awt.image.*;
import java.util.*;
public final class Peano
{
private int x = 0;
private int y = 0;
private final List<Coordinate> points = new ArrayList<Coordinate>();
private static final class Coordinate {
public final int x;
public final int y;
public Coordinate... | PeanoShuffle/Peano.java | 0.837753 | 0.423875 | Peano.java | starcoder |
package com.opengamma.math.minimization;
import org.apache.commons.lang.NotImplementedException;
import com.opengamma.math.MathException;
import com.opengamma.math.function.Function1D;
import com.opengamma.math.matrix.DoubleMatrix1D;
import com.opengamma.math.matrix.DoubleMatrix2D;
import com.opengamma.math.matrix.Do... | projects/OG-Analytics/src/com/opengamma/math/minimization/QuasiNewtonVectorMinimizer.java | 0.91334 | 0.71561 | QuasiNewtonVectorMinimizer.java | starcoder |
package org.codi.catan.impl.game;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
import java.util.Arrays;
import java.util.Collection;
import javax.inject.Singleton;
import org.codi.catan.core.BadRequestException;
import org.codi.catan.core.CatanException;
import org.codi.cat... | server/src/main/java/org/codi/catan/impl/game/GraphHelper.java | 0.882105 | 0.460228 | GraphHelper.java | starcoder |
package uk.co.cpascoe.huffman;
import java.util.*;
import java.lang.*;
public abstract class HuffmanCompressor {
public static byte[] compress(byte[] data) {
int[] frequencies = new int[256];
for (byte b : data) {
frequencies[Utils.toUnsignedByte(b)]++;
}
Node rootNod... | src/main/java/uk/co/cpascoe/huffman/HuffmanCompressor.java | 0.879082 | 0.471467 | HuffmanCompressor.java | starcoder |
package nz.gen.geek_central.GLUseful;
/*
Functional 3D matrix operations. Matrix elements are in row-major order.
Vectors are treated as column vectors and premultiplied, i.e.
[x'] [m11 m12 m13 m14] [x]
[y'] = [m21 m22 m23 m24] × [y]
[z'] [m31 m32 m33 m34] [z]
[w'] [m4... | src/Mat4f.java | 0.731251 | 0.70028 | Mat4f.java | starcoder |
package org.adamalang.translator.tree.types.checking;
import org.adamalang.translator.env.ComputeContext;
import org.adamalang.translator.env.Environment;
import org.adamalang.translator.tree.expressions.Expression;
import org.adamalang.translator.tree.types.TyType;
import org.adamalang.translator.tree.types.checking.... | core/src/main/java/org/adamalang/translator/tree/types/checking/LocalTypeAssignmentResult.java | 0.766556 | 0.425784 | LocalTypeAssignmentResult.java | starcoder |
package gov.nasa.worldwindx.examples;
import gov.nasa.worldwind.*;
import gov.nasa.worldwind.avlist.AVKey;
import gov.nasa.worldwind.awt.WorldWindowGLCanvas;
import gov.nasa.worldwind.layers.WorldMapLayer;
import gov.nasa.worldwind.util.StatusBar;
import javax.swing.*;
import javax.swing.border.*;
import java.awt.*;
... | HW08/libs/WWJ/code/src/gov/nasa/worldwindx/examples/SplitPaneUsage.java | 0.820037 | 0.465934 | SplitPaneUsage.java | starcoder |
package com.alg.twoPointers;
/**
* Now the input array is sorted, and you have to use O(N) time to finish.
* Given a 1-indexed array of integers numbers that is already sorted in non-decreasing order, find two numbers such that they add up to a specific target number. Let these two numbers be numbers[index1] and num... | algorithms/src/com/alg/twoPointers/TwoPointersII.java | 0.903104 | 0.748053 | TwoPointersII.java | starcoder |
package com.tukeping.practice.courses.basic.p6;
import java.util.Collection;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.PriorityQueue;
import java.util.Set;
//undirected graph only
public class Code_04_Kruskal {
// Union-Find Set
public static class UnionFind ... | src/main/java/com/tukeping/practice/courses/basic/p6/Code_04_Kruskal.java | 0.780244 | 0.452475 | Code_04_Kruskal.java | starcoder |
package com.jack.leetcode.easy;
/**
Description
Given a binary search tree and the lowest and highest boundaries as L and R, trim the tree so that all its elements lies in [L, R] (R >= L). You might need to change the root of the tree, so the result should return the new root of the trimmed binary search tree.
Exampl... | algorithms/java/E669_TrimBinarySearchTree.java | 0.740268 | 0.510252 | E669_TrimBinarySearchTree.java | starcoder |
package edu.uiowa.smt.parser.antlr;
import org.antlr.v4.runtime.tree.ParseTreeVisitor;
/**
* This interface defines a complete generic visitor for a parse tree produced
* by {@link SmtParser}.
*
* @param <T> The return type of the visit operation. Use {@link Void} for
* operations with no return type.
*/
public ... | src/main/java/edu/uiowa/smt/parser/antlr/SmtVisitor.java | 0.867275 | 0.456713 | SmtVisitor.java | starcoder |
package de.dbvis.parser;
import de.dbvis.structured.Sentence;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.text.ParseException;
import java.util.*;
/**
* Created by <NAME> (University of Konstanz).
*/
public abstract class AbstractCYKParser implements Parser {
private static final Logge... | src/main/java/de/dbvis/parser/AbstractCYKParser.java | 0.888433 | 0.500183 | AbstractCYKParser.java | starcoder |
package synth.osc;
import net.beadsproject.beads.core.AudioContext;
import net.beadsproject.beads.core.UGen;
import net.beadsproject.beads.data.Buffer;
import net.beadsproject.beads.data.Pitch;
import synth.modulation.*;
public class SmartOscillator extends Oscillator implements UnisonOscillator, WavetableOscillator... | src/synth/osc/SmartOscillator.java | 0.856122 | 0.473231 | SmartOscillator.java | starcoder |
package org.xrpl.xrpl4j.model.client.common;
import com.google.common.base.Preconditions;
import com.google.common.primitives.UnsignedInteger;
import com.google.common.primitives.UnsignedLong;
import org.xrpl.xrpl4j.model.immutables.FluentCompareTo;
import java.util.Objects;
/**
* Represents a ledger index, which c... | xrpl4j-model/src/main/java/org/xrpl/xrpl4j/model/client/common/LedgerIndex.java | 0.944504 | 0.55658 | LedgerIndex.java | starcoder |
package com.actelion.research.chem.conf;
import com.actelion.research.chem.Molecule;
import com.actelion.research.chem.StereoMolecule;
import com.actelion.research.util.Angle;
import com.actelion.research.util.DoubleFormat;
public class TorsionDescriptor {
private static final float TORSION_EQUIVALENCE_TOLERANCE = (... | src/com/actelion/research/gwt/chemlib/com/actelion/research/chem/conf/TorsionDescriptor.java | 0.894703 | 0.49109 | TorsionDescriptor.java | starcoder |
package de.free_creations.microsequencer;
import de.free_creations.midiutil.BeatPosition;
import de.free_creations.midiutil.RPosition;
import de.free_creations.midiutil.RPositionEx;
import java.io.IOException;
import javax.sound.midi.MidiUnavailableException;
import javax.sound.midi.Sequence;
import javax.sound.midi.S... | MicroSequencer/src/de/free_creations/microsequencer/MicroSequencer.java | 0.859516 | 0.439567 | MicroSequencer.java | starcoder |
package Backtracking;
/**
* Given a partially filled 9×9 2D array ‘grid[9][9]’, the goal is to assign digits (from 1 to 9) to the
* empty cells so that every row, column, and subgrid of size 3×3 contains exactly one instance of the digits from 1 to 9.
*/
public class Sudoku {
public static void main(String[] ar... | src/main/java/Backtracking/Sudoku.java | 0.807537 | 0.599925 | Sudoku.java | starcoder |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.