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 com.opengamma.analytics.financial.provider.calculator.discounting;
import java.util.Map;
import com.opengamma.analytics.ShiftType;
import com.opengamma.analytics.financial.instrument.index.IborIndex;
import com.opengamma.analytics.financial.instrument.index.IndexON;
import com.opengamma.analytics.financial.int... | projects/OG-Analytics/src/main/java/com/opengamma/analytics/financial/provider/calculator/discounting/GammaPV01CurveParametersCalculator.java | 0.947229 | 0.680799 | GammaPV01CurveParametersCalculator.java | starcoder |
package com.google.j2cl.transpiler.regression.mediumbridgesshard25;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
@RunWith(JUnit4.class)
public class TestShard {
@Test
public void testCase8311() {
TestCase8311.test();
}
@Test
public void testCase8848() {
T... | transpiler/javatests/com/google/j2cl/transpiler/regression/mediumbridgesshard25/TestShard.java | 0.805976 | 0.64944 | TestShard.java | starcoder |
package com.gengoai.graph;
/**
* A set of common edge merge functions.
*
* @author <NAME>
*/
public final class EdgeMergeFunctions {
/**
* A merge function that keeps the original edge and ignores the duplicate.
*
* @param <V> The vertex type
* @return An EdgeMergeFunction
*/
public stat... | mango/src/main/java/com/gengoai/graph/EdgeMergeFunctions.java | 0.868018 | 0.563438 | EdgeMergeFunctions.java | starcoder |
package com.silentmatt.dss.calc;
import com.silentmatt.dss.Immutable;
import com.silentmatt.dss.term.NumberTerm;
import com.silentmatt.dss.term.Term;
/**
* Represents a dimensioned value.
*
* @author <NAME>
*/
@Immutable
public final class Value {
private final double scalar;
private final CalculationUnit... | src/com/silentmatt/dss/calc/Value.java | 0.968649 | 0.527438 | Value.java | starcoder |
package cell_society.backend.automata.rock_paper_scissors;
import cell_society.backend.automata.Neighbors;
import cell_society.backend.automata.grid_styles.Grid;
/**
* Defines a Rock play in extended rock-paper-scissors
*
* @author <NAME>
*/
public class RockCell extends RPSCell {
/**
* Parameter-less const... | src/cell_society/backend/automata/rock_paper_scissors/RockCell.java | 0.925407 | 0.494995 | RockCell.java | starcoder |
package us.ihmc.sensorProcessing.pointClouds.shape;
import org.ejml.data.DMatrixRMaj;
import org.ejml.dense.row.CommonOps_DDRM;
import georegression.geometry.GeometryMath_F64;
import georegression.geometry.UtilPlane3D_F64;
import georegression.metric.Intersection3D_F64;
import georegression.struct.line.LineParametric... | ihmc-sensor-processing/src/main/java/us/ihmc/sensorProcessing/pointClouds/shape/EstimateMotionFromBox.java | 0.712332 | 0.549399 | EstimateMotionFromBox.java | starcoder |
* The CourseGrades class provides a framework for working with class grades
*/
public class CourseGrades implements Analyzable
{
//Create basic values
private final int NUM_GRADES = 4;
private GradedActivity[] grades = new GradedActivity[NUM_GRADES];
/**
* The CourseGrades constructor creates... | Assignments/AS10/CourseGrades.java | 0.848251 | 0.566198 | CourseGrades.java | starcoder |
package com.scm.reader.livescanner.sdk.image;
import android.graphics.*;
import com.scm.reader.livescanner.util.LogUtils;
import java.io.ByteArrayOutputStream;
/**
* ImageScaler allows to scale and compress raw frames from the camera into compressed
* JPEGs.
*/
public class ImageScaler {
public static final St... | src/main/java/com/scm/reader/livescanner/sdk/image/ImageScaler.java | 0.939283 | 0.482307 | ImageScaler.java | starcoder |
import java.util.AbstractList;
import java.util.Comparator;
public class HeapSort {
/*
* @param array
* @param indices
*/
@SuppressWarnings({"rawtypes"})
public static void sort(AbstractList<Comparable> array, int[] indices) {
// ensures we are starting with valid indic... | src/HeapSort.java | 0.603932 | 0.425367 | HeapSort.java | starcoder |
package io.binac.leetcode;
/**
* <p>Given two sorted arrays <code>nums1</code> and <code>nums2</code> of size <code>m</code> and <code>n</code> respectively, return <strong>the median</strong> of the two sorted arrays.</p>
* <p><strong>Follow up:</strong> The overall run time complexity should be <code>O(log (m+n))<... | java/src/main/java/io/binac/leetcode/MedianOfTwoSortedArrays.java | 0.776411 | 0.544983 | MedianOfTwoSortedArrays.java | starcoder |
package co.edu.uniandes.csw.boda.ejb;
import co.edu.uniandes.csw.boda.entities.BodaEntity;
import co.edu.uniandes.csw.boda.entities.OpcionServicioEntity;
import co.edu.uniandes.csw.boda.entities.ProveedorEntity;
import co.edu.uniandes.csw.boda.exceptions.BusinessLogicException;
import co.edu.uniandes.csw.boda.persisten... | boda-back/src/main/java/co/edu/uniandes/csw/boda/ejb/OpcionServicioLogic.java | 0.595728 | 0.417925 | OpcionServicioLogic.java | starcoder |
package com.vavi.thread;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.security.ProtectionDomain;
/**
* A collection of methods for performing low-level, unsafe operations. Although
* the class and all methods are public, use of this class is limited because
* only trusted code can... | src/main/java/com/vavi/thread/Unsafe.java | 0.919866 | 0.433442 | Unsafe.java | starcoder |
package utils;
/**
* I ended up doing so much vector math I thought
* a class would simplify things. You can init a
* vector with x and y or with length and direction,
* but then you must supply a third argument with
* true. Vectors are immutable.
*
* @author Austin
*
*/
public class Vector {
public final ... | src/utils/Vector.java | 0.892082 | 0.61581 | Vector.java | starcoder |
package study.daydayup.wolf.common.util.time;
import lombok.NonNull;
import java.text.SimpleDateFormat;
import java.time.*;
import java.time.format.DateTimeFormatter;
import java.time.temporal.WeekFields;
import java.util.Date;
/**
* study.daydayup.wolf.common.util
*
* @author Wingle
* @since 2019/10/23 10:44 下午... | lib/common/src/main/java/study/daydayup/wolf/common/util/time/DateUtil.java | 0.860911 | 0.458409 | DateUtil.java | starcoder |
package Ficha4;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;
public class EncEficiente {
private String nomeCliente, nf, morada;
private int numE;
private LocalDate dataEnc;
private List<LinhaEncomenda> linhas;
public EncEficiente () {
this.nomeCliente = ... | Ficha4/src/Ficha4/EncEficiente.java | 0.636918 | 0.497986 | EncEficiente.java | starcoder |
package _02AVLTreeDeletion;
import java.util.function.Consumer;
public class AVL<T extends Comparable<T>> {
private Node<T> root;
public Node<T> getRoot() {
return this.root;
}
public boolean contains(T item) {
Node<T> node = this.search(this.root, item);
return node != null... | 07AVLTreesAATrees/src/_02AVLTreeDeletion/AVL.java | 0.792745 | 0.457621 | AVL.java | starcoder |
package com.opengamma.financial.analytics;
import java.util.Collections;
import java.util.Random;
import java.util.Set;
import com.opengamma.engine.ComputationTarget;
import com.opengamma.engine.ComputationTargetType;
import com.opengamma.engine.function.AbstractFunction;
import com.opengamma.engine.function.Function... | projects/OG-Financial/src/com/opengamma/financial/analytics/AbstractDummyLabelledMatrix2DFunction.java | 0.839504 | 0.606178 | AbstractDummyLabelledMatrix2DFunction.java | starcoder |
package io.jenetics.prog.op;
import static java.util.Objects.requireNonNull;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import java.io.InvalidObjectException;
import java.io.ObjectInputStream;
import java.io.Serializable;
import java.util.Comparator;
import java.util.EnumMap;
imp... | jenetics.prog/src/main/java/io/jenetics/prog/op/MathExpr.java | 0.804175 | 0.428771 | MathExpr.java | starcoder |
package org.axonframework.messaging.responsetypes;
import java.io.Serializable;
import java.lang.reflect.Type;
import java.util.Optional;
/**
* Specifies the expected response type required when performing a query through the {@link
* org.axonframework.queryhandling.QueryBus}/{@link org.axonframework.queryhandling.... | messaging/src/main/java/org/axonframework/messaging/responsetypes/ResponseType.java | 0.945889 | 0.681369 | ResponseType.java | starcoder |
package org.tribuo.interop.tensorflow;
import org.tensorflow.Graph;
import org.tensorflow.Operand;
import org.tensorflow.framework.optimizers.AdaDelta;
import org.tensorflow.framework.optimizers.AdaGrad;
import org.tensorflow.framework.optimizers.AdaGradDA;
import org.tensorflow.framework.optimizers.Adam;
import org.t... | Interop/Tensorflow/src/main/java/org/tribuo/interop/tensorflow/GradientOptimiser.java | 0.89177 | 0.597373 | GradientOptimiser.java | starcoder |
package frc.team7170.lib.math;
import java.util.stream.IntStream;
/**
* A collection of various calculations that might be done frequently enough throughout the robot code as to warrant a
* unified location for all of them.
*
* @author <NAME>
*/
public final class CalcUtil {
private static final double EPS... | src/main/java/frc/team7170/lib/math/CalcUtil.java | 0.947003 | 0.721069 | CalcUtil.java | starcoder |
import edu.princeton.cs.algs4.FlowEdge;
import edu.princeton.cs.algs4.FlowNetwork;
import edu.princeton.cs.algs4.FordFulkerson;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.LinkedList;
import java.util.List;
import java.util.stream.Stream;
import java.util.stream.S... | week_8/src/main/java/Eliminator.java | 0.896987 | 0.421135 | Eliminator.java | starcoder |
package edu.purdue.cs.percolator;
import com.github.tkutcher.jgrade.gradedtest.GradedTestResult;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import org.junit.runner.Description;
import org.junit.runner.notification.Fai... | src/main/java/edu/purdue/cs/percolator/TestCaseListener.java | 0.918027 | 0.439928 | TestCaseListener.java | starcoder |
package com.perunlabs.jsolid.util;
import static org.testory.Testory.thenReturned;
import static org.testory.Testory.thenThrown;
import static org.testory.Testory.when;
import org.hamcrest.Matcher;
import org.junit.Test;
public class CheckTest {
@Test
public void positive_int_returns_value_when_positive() throws... | src/junit/com/perunlabs/jsolid/util/CheckTest.java | 0.886648 | 0.624709 | CheckTest.java | starcoder |
package io.leitstand.inventory.service;
import static io.leitstand.commons.model.BuilderUtil.assertNotInvalidated;
import static java.util.Arrays.stream;
import static java.util.Collections.emptyList;
import static java.util.Collections.unmodifiableList;
import static java.util.stream.Collectors.toList;
import java.u... | leitstand-inventory-api/src/main/java/io/leitstand/inventory/service/ElementEnvironments.java | 0.846419 | 0.408867 | ElementEnvironments.java | starcoder |
package simulation;
import java.io.Serializable;
/**
* This is more like a negative control of a super trivial "model"
*
*
* @author croth
*/
public class TrivialModel extends AbstractLHVModel implements Serializable{
private static final long serialversionUID =1L;
private Rand rand;
/*
A ... | src/simulation/TrivialModel.java | 0.925617 | 0.452536 | TrivialModel.java | starcoder |
package xal.tools.math.rn;
import xal.tools.math.BaseMatrix;
import xal.tools.math.BaseVector;
/**
* Real matrix with arbitrary row and column dimensions. This class supports the usual
* matrix operations for non-square matrices but does not optimize for square matrices.
* Because general matrix dimensions must b... | core/src/xal/tools/math/rn/Rmxn.java | 0.923825 | 0.625724 | Rmxn.java | starcoder |
package edu.cmu.hcii.citrus.views;
import edu.cmu.hcii.citrus.*;
public class Debug extends BaseElement<Debug> {
public static final Dec<Bool> worker = new Dec<Bool>(new Bool(false));
public static final Dec<Bool> memory = new Dec<Bool>(new Bool(false));
public static final Dec<Bool> events = new Dec<Bool>(new B... | edu/cmu/hcii/citrus/views/Debug.java | 0.599251 | 0.424889 | Debug.java | starcoder |
package Representation;
/**
* Segmented Sum of Variation (SSV) is a method that divides the original data series
* into N segments, these segments are connected, i.e., the end of a segment is
* the beginning of the next segment. This is necessary because the method calculates the
* variation of each segment, if... | src/Representation/SSV.java | 0.737725 | 0.577227 | SSV.java | starcoder |
package net.kcundercover.jdsp.filters;
public class FilterDesign {
/** Design filter based on windowing technique
*
* @param window Window Type from {"BARTLETT", "HAMMING", "HANN"}
* @param x The x range to design the filter
* @return The designed window function
*/
public static float[... | src/main/java/jdsp/filters/FilterDesign.java | 0.752831 | 0.450299 | FilterDesign.java | starcoder |
package org.interledger.ilqp;
import java.util.Collection;
import java.util.HashSet;
import java.util.Objects;
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;
/**
* Liquidity curves describe the relationship between input and output amount for a given path
* between a pair of ledgers.
*... | src/main/java/org/interledger/ilqp/LiquidityCurve.java | 0.945939 | 0.620305 | LiquidityCurve.java | starcoder |
package com.imooc.array;
import java.util.NoSuchElementException;
public class Array<T> {
private T[] data;
private int size;
public Array(int capacity) {
data = (T[]) new Object[capacity];
size = 0;
}
// constructor, pass in the capacity to construct the array
public Array(... | src/com/imooc/array/Array.java | 0.632049 | 0.614336 | Array.java | starcoder |
package de.turingfx.model.turing;
import de.turingfx.model.exceptions.TuringMachineException;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
/**
* @author <NAME> (msg systems ag) 2018
*/
@Data
public class Tape {
public static final int MAX_VISIBLE_CELLS = 20;
private int viewRang... | src/main/java/de/turingfx/model/turing/Tape.java | 0.833325 | 0.434281 | Tape.java | starcoder |
package org.jay3d.engine.core.math;
/**
* The Matrix class maintains a four by four(4x4) matrix in row order.
*
* <p>
* Matrix4f is used to apply translation and/or rotation, which includes multiple
* convenience methods for creating the Matrices, tranforming them by vectors or rotating them.
* </p>
*
... | src/org/jay3d/engine/core/math/Matrix4f.java | 0.898619 | 0.558026 | Matrix4f.java | starcoder |
package net.logicsquad.nanocaptcha.image.renderer;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.util.Random;
import java.util.concurrent.atomic.AtomicInteger;
/**
* <p>
* Based on the {@link DefaultWordRenderer}, this implementation strips... | src/main/java/net/logicsquad/nanocaptcha/image/renderer/FastWordRenderer.java | 0.881494 | 0.40486 | FastWordRenderer.java | starcoder |
package org.ddogleg.rand;
import org.ejml.alg.dense.mult.VectorVectorMult;
import org.ejml.data.DenseMatrix64F;
import org.ejml.factory.LinearSolverFactory;
import org.ejml.interfaces.decomposition.CholeskyDecomposition;
import org.ejml.interfaces.linsol.LinearSolver;
import org.ejml.ops.CommonOps;
import java.util.R... | src/org/ddogleg/rand/MultivariateGaussianDraw.java | 0.875534 | 0.50653 | MultivariateGaussianDraw.java | starcoder |
package q950;
import java.util.ArrayDeque;
import java.util.Arrays;
import java.util.Queue;
import org.junit.runner.RunWith;
import util.runner.Answer;
import util.runner.LeetCodeRunner;
import util.runner.TestData;
import util.runner.data.DataExpectation;
/**
* [Hard] 924. Minimize Malware Spread
* https://leetcod... | src/main/java/q950/Q924_MinimizeMalwareSpread.java | 0.859266 | 0.566438 | Q924_MinimizeMalwareSpread.java | starcoder |
import org.junit.Before;
import org.junit.Test;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertArrayEquals;
import sta... | Binary Search Trees/LevelOrderTests.java | 0.870308 | 0.590484 | LevelOrderTests.java | starcoder |
package struct.array;
/**
* 数组
* 插入元素(头部、尾部、指定下角标)
* 删除元素(头部、尾部、指定下角标)
* 扩容
*
* @param <T>
*/
public class Array<T> {
private T[] data;
private int size;
public Array(int capacity) {
this.data = (T[]) new Object[capacity];
this.size = 0;
}
public Array() {
this(10)... | Code/src/struct/array/Array.java | 0.543348 | 0.459925 | Array.java | starcoder |
package hivemall.math.matrix;
import hivemall.math.matrix.builders.MatrixBuilder;
import hivemall.math.matrix.ints.IntMatrix;
import hivemall.math.matrix.sparse.CSCMatrix;
import hivemall.math.matrix.sparse.CSRMatrix;
import hivemall.math.matrix.sparse.floats.CSCFloatMatrix;
import hivemall.math.matrix.sparse.floats.C... | core/src/main/java/hivemall/math/matrix/MatrixUtils.java | 0.885545 | 0.556942 | MatrixUtils.java | starcoder |
package algorithms;
import common.ScalingFunction;
public class OrderSimilarityFunction {
private double taskCompletionTimeCoefficient;
private ScalingFunction taskCompletionTimeDifferenceScalingFunction;
private double taskDistanceCoefficient;
private ScalingFunction taskDistanceScalingFunction;
... | solver/src/algorithms/OrderSimilarityFunction.java | 0.673299 | 0.572663 | OrderSimilarityFunction.java | starcoder |
package cn.gyyx.bts.core;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* Created by lishile on 2016/3/3.
*/
public class Values {
private HashMap<String, Object> values;
public Values() {
values = new HashMap<String, Object>(8);
}
public ... | parent/core/src/main/java/cn/gyyx/bts/core/Values.java | 0.845481 | 0.487368 | Values.java | starcoder |
package es.usc.citius.lab.joctomap.util;
import java.io.*;
import java.util.Scanner;
public class MapFileReader {
private String format;
private int[][][] pixels;
private int sizeX;
private int sizeY;
private int maxValue;
/**
* Constructor of the class, that reads the information in the PPM file and store... | joctomap-core/src/main/java/es/usc/citius/lab/joctomap/util/MapFileReader.java | 0.727879 | 0.41745 | MapFileReader.java | starcoder |
package de.renew.dbnets.datalogic;
import java.util.Collections;
import java.util.Map;
/**
* The db-net's data logic layer's action's edited (added/deleted) fact -
* the rows of the table being added to/deleted from the database during the action performing.
*
* @author <NAME>, National Research University - High... | root/prj/sol/projects/renew2.5source/renew2.5/src/DBNets/src/de/renew/dbnets/datalogic/EditedFact.java | 0.881475 | 0.402627 | EditedFact.java | starcoder |
package de.cubenation.cnportals.model;
import com.sk89q.worldedit.math.BlockVector3;
import org.bukkit.Location;
import org.bukkit.World;
public class PortalDimensions {
private World world;
private Double xMin;
private Double yMin;
private Double zMin;
private Double xMax;
private Double yMa... | src/main/java/de/cubenation/cnportals/model/PortalDimensions.java | 0.798029 | 0.589923 | PortalDimensions.java | starcoder |
package ca.waterloo.dsg.graphflow.util;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Objects;
import java.util.Set;
/**
* Stores a mapping of {@code String} keys to {@code ... | src/main/java/ca/waterloo/dsg/graphflow/util/StringToIntKeyMap.java | 0.952486 | 0.477128 | StringToIntKeyMap.java | starcoder |
package ru.ispras.microtesk.translator.mir;
import java.math.BigInteger;
public class Constant implements Operand {
private final int bits;
private final BigInteger value;
private Constant(final int bits, final BigInteger value) {
this.bits = bits;
this.value = value;
}
public static Constant valu... | src/main/java/core/ru/ispras/microtesk/translator/mir/Constant.java | 0.923325 | 0.725223 | Constant.java | starcoder |
package com.rharel.pong.geometry;
import com.rharel.pong.util.MathUtility;
/**
* Simple 2D vector class.
*
* @author <NAME>
*/
public class Vector2
{
public static final Vector2 X = new Vector2(1, 0);
public static final Vector2 Y = new Vector2(0, 1);
public Vector2(
final float x,
final float y)
{
... | pong/src/com/rharel/pong/geometry/Vector2.java | 0.95636 | 0.57818 | Vector2.java | starcoder |
package bot;
import bot.misc.Helper;
import bot.simulation.*;
import bot.simulation.objects.Movable;
import java.util.Vector;
import java.util.concurrent.ThreadLocalRandom;
public class Script {
public Bot bot;
public SimulationRunner guiSimulationRunner;
public Script(Bot bot) {
this.bot = bot;... | src/bot/Script.java | 0.779951 | 0.509215 | Script.java | starcoder |
package pl.poznan.put.torsion;
import org.immutables.value.Value;
import pl.poznan.put.circular.Angle;
import pl.poznan.put.circular.samples.AngleSample;
import pl.poznan.put.circular.samples.ImmutableAngleSample;
import pl.poznan.put.pdb.analysis.MoleculeType;
import pl.poznan.put.pdb.analysis.PdbResidue;
import pl.p... | src/main/java/pl/poznan/put/torsion/AverageTorsionAngleType.java | 0.925474 | 0.67173 | AverageTorsionAngleType.java | starcoder |
package qea.properties.crv15.offline;
import qea.creation.QEABuilder;
import static qea.structure.intf.Guard.*;
import static qea.structure.intf.Assignment.*;
import qea.structure.intf.QEA;
public class OCLR_3 {
/*
* globally c preceding at least 100 tu d;
*
* This property can be expressed using the globall... | qeaProperties/src/qea/properties/crv15/offline/OCLR_3.java | 0.52683 | 0.45308 | OCLR_3.java | starcoder |
package de.sg.benno;
import de.sg.benno.file.ImageFile;
import de.sg.benno.ogl.resource.Texture;
import org.joml.Vector2f;
import java.io.IOException;
import java.util.ArrayList;
import static org.lwjgl.opengl.GL11.GL_RGBA8;
import static org.lwjgl.opengl.GL11.glBindTexture;
import static org.lwjgl.opengl.GL12.GL_BG... | src/main/java/de/sg/benno/TileAtlas.java | 0.787319 | 0.439447 | TileAtlas.java | starcoder |
package me.psanders.utils;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
/** Iterator over the lexicographic permutations of a list.
*
* <p>Take in a items of elements which have a natural ordering. Suppose that the elements are
* in descending order o... | src/main/java/me/psanders/utils/LexicographicPermuter.java | 0.877791 | 0.612078 | LexicographicPermuter.java | starcoder |
package com.cisco.learning.four.collections;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
public class CollectionsShowcase {
public static void main(String... | src/com/cisco/learning/four/collections/CollectionsShowcase.java | 0.843702 | 0.410638 | CollectionsShowcase.java | starcoder |
package com.challenge.adventure.game;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
public class Main {
private static Map<Integer, Location> locations = new HashMap<>();
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
locations.... | Java Collections/challenge-28-adventure-game/src/com/challenge/adventure/game/Main.java | 0.726231 | 0.500305 | Main.java | starcoder |
package io.github.ytanaka.cliptrans.dic;
import junit.framework.TestCase;
import java.util.List;
public class FuzzyWordEnglishTest extends TestCase {
FuzzyWordEnglish f = new FuzzyWordEnglish();
private void t(String n, String x) {
List<String> list = f.normalize(x);
assertTrue(x + " => " + ... | app/src/androidTest/java/io/github/ytanaka/cliptrans/dic/FuzzyWordEnglishTest.java | 0.507812 | 0.404331 | FuzzyWordEnglishTest.java | starcoder |
package algo.homework;
/**
* Created on 15/10/10.
* Author: ylgrgyq
*/
public class StackAndQueue {
/**
* Queue with two stacks. Implement a queue with two stacks so that each queue operations takes a constant
* amortized number of stack operations.
*/
/**
* Stack with max. Create a dat... | src/main/java/algo/homework/StackAndQueue.java | 0.781414 | 0.51751 | StackAndQueue.java | starcoder |
package gov.sandia.cognition.learning.data;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import junit.framework.TestCase;
/**
*
* @author jdbasil
*/
public class DefaultWeightedInputOutputPairTest extends TestCase
{
public DefaultWeightedInputOutputPairTest(String testName)... | Components/LearningCore/Test/gov/sandia/cognition/learning/data/DefaultWeightedInputOutputPairTest.java | 0.852184 | 0.470554 | DefaultWeightedInputOutputPairTest.java | starcoder |
package pca_transform.covmatrixevd;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import Jama.EigenvalueDecomposition;
import Jama.Matrix;
/**
* Eigenvalue decomposition with eigenvectors sorted according to corresponding
* eigenvalues in a decreasing order. The eigenvalues... | src/pca_transform/covmatrixevd/EVD.java | 0.85558 | 0.531817 | EVD.java | starcoder |
package com.z0ltan.compilers.triangle.encoder;
public class Machine {
// machine status
public static int status = Machine.VMStatuses.notStarted;
// code store
private static final int CODESIZE = 1024;
private static final int PRIMITIVES_COUNT = 28;
public static final int maxRoutineLevel = 7;
public st... | src/main/java/com/z0ltan/compilers/triangle/encoder/Machine.java | 0.579043 | 0.409339 | Machine.java | starcoder |
package edu.itu.the_d.map.datastructures;
import java.io.Serializable;
/**
* An undirected edge that can store multiple weights and one byte to describe the {@link WayEdge#dirFlags}.
* Is used by the {@link WayUndirectedGraph} and {@link Dijkstra} for path finding.
*/
public class WayEdge implements Serializable {... | src/edu/itu/the_d/map/datastructures/WayEdge.java | 0.908471 | 0.607634 | WayEdge.java | starcoder |
package com.jd.blockchain.ledger;
import java.math.BigInteger;
import java.util.Date;
import com.jd.blockchain.binaryproto.PrimitiveType;
import com.jd.blockchain.crypto.HashDigest;
import com.jd.blockchain.crypto.PubKey;
import com.jd.blockchain.crypto.SignatureDigest;
import com.jd.blockchain.utils.Bytes;
import co... | source/ledger/ledger-model/src/main/java/com/jd/blockchain/ledger/TypedValue.java | 0.79999 | 0.40807 | TypedValue.java | starcoder |
package org.example.corp.engine.util;
import org.lwjgl.opengl.GL15;
import org.lwjgl.system.MemoryUtil;
import java.nio.Buffer;
import java.nio.FloatBuffer;
import java.nio.IntBuffer;
import static org.lwjgl.system.MemoryUtil.*;
public class GLUtils {
public static final int[] SQUARE_ELEMENTS_ARRAY = new int[]... | src/main/java/org/example/corp/engine/util/GLUtils.java | 0.850251 | 0.455804 | GLUtils.java | starcoder |
package org.la4j.factory;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Random;
import org.la4j.matrix.Matrices;
import org.la4j.matrix.Matrix;
import org.la4j.matrix.source.MatrixSource;
import org.la4j.matrix.sparse.CCSMatrix;
import org.la4j.matrix.sparse.CRSMatrix;
@Deprecated
public clas... | libs/la4j-0.5.0/src/main/java/org/la4j/factory/CCSFactory.java | 0.815122 | 0.564219 | CCSFactory.java | starcoder |
package com.liyafeng.algorithm.leetcode.array;
import java.util.HashMap;
public class LeetCode_1_TwoSum_Easy {
/**
* 给定一个数组,和一个目标值,找出数组中和是目标值的两个元素的位置
* <p>
* ===========
* Given an array of integers, return indices of the two numbers such that they add up to a specific target.
* <p>
... | Algorithm/src/main/java/com/liyafeng/algorithm/leetcode/array/LeetCode_1_TwoSum_Easy.java | 0.699152 | 0.516656 | LeetCode_1_TwoSum_Easy.java | starcoder |
package org.db2project.EventDetection.Classifier;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
/**
* This class models an graph using adjacency lists.
*
* @author eleal
*
* @param <T>
*... | EventDetection/src/main/java/org/db2project/EventDetection/Classifier/AdjacencyListGraph.java | 0.740831 | 0.48621 | AdjacencyListGraph.java | starcoder |
package org.spongepowered.api.block;
import net.glowstone.block.BlockBehavior;
import net.glowstone.block.GlowBlockType;
import net.glowstone.block.behavior.*;
import net.glowstone.block.stateresolver.*;
import org.spongepowered.api.item.ItemTypes;
import java.util.Arrays;
/**
* An enumeration of all possible {@lin... | src/main/java/org/spongepowered/api/block/BlockTypes.java | 0.615897 | 0.657978 | BlockTypes.java | starcoder |
package org.elasticsearch.cluster.routing;
import org.apache.lucene.util.CollectionUtil;
import org.elasticsearch.common.util.Countable;
import java.util.Iterator;
import java.util.List;
/**
* This class implements a compilation of {@link ShardIterator}s. Each {@link ShardIterator}
* iterated by this {@link Iterab... | server/src/main/java/org/elasticsearch/cluster/routing/GroupShardsIterator.java | 0.925953 | 0.426919 | GroupShardsIterator.java | starcoder |
package particles;
import java.util.Arrays;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.math.Vector2;
import com.mygdx.game.Camera;
public class Particles
{
private static final int SIZE = 1000;
private static final float DEFAULTDECAY = 5f;
private Ember[] embers;
private Particl... | game/core/src/particles/Particles.java | 0.526343 | 0.421969 | Particles.java | starcoder |
package com.max.erickson.graph;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
/**
* Graph representation as an adjacency list.
* Undirected.
*/
public class Graph {
... | src/main/java/com/max/erickson/graph/Graph.java | 0.906459 | 0.482002 | Graph.java | starcoder |
package cz.muni.fi.spnp.core.transformators.spnp.distributions;
import cz.muni.fi.spnp.core.models.places.StandardPlace;
import cz.muni.fi.spnp.core.models.transitions.distributions.TransitionDistributionType;
import cz.muni.fi.spnp.core.models.visitors.TransitionDistributionVisitor;
import cz.muni.fi.spnp.core.transf... | transformators/src/main/java/cz/muni/fi/spnp/core/transformators/spnp/distributions/ParetoTransitionDistribution.java | 0.934642 | 0.489931 | ParetoTransitionDistribution.java | starcoder |
import java.util.*;
import java.util.stream.Collectors;
public class MergeIntervals {
public int[][] merge(int[][] intervals) {
if (intervals.length == 1)
return intervals;
List<int[]> sortedArrayEntries = Arrays.stream(intervals)
.sorted(Comparator.comparingInt(arrayE... | src/MergeIntervals.java | 0.81257 | 0.47457 | MergeIntervals.java | starcoder |
package cn.edu.cug.cs.gtl.geom;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import java.util.*;
import java.util.function.Consumer;
/**
* Created by hadoop on 17-3-25.
*/
public class PackedVectorSequence implements VectorSequence {
private static final long serialVersionUID... | common/src/main/java/cn/edu/cug/cs/gtl/geom/PackedVectorSequence.java | 0.823931 | 0.635788 | PackedVectorSequence.java | starcoder |
package queue;
import java.util.*;
public class Leetcode692TopKFrequentWords {
/*
692. Top K Frequent Words
Given an array of strings words and an integer k, return the k most frequent strings.
Return the answer sorted by the frequency from highest to lowest.
Sort the words with the same frequency... | arrows/src/main/java/queue/Leetcode692TopKFrequentWords.java | 0.917188 | 0.807954 | Leetcode692TopKFrequentWords.java | starcoder |
package fr.ritaly.dungeonmaster.actuator;
import org.apache.commons.lang.Validate;
/**
* Implementation of {@link Actuator} used to repeatedly trigger a
* {@link Triggerable} up to a given number of times.
*
* @author <a href="mailto:<EMAIL>"><NAME></a>
*/
public class LoopingActuator implements Actuator {
/**... | src/main/java/fr/ritaly/dungeonmaster/actuator/LoopingActuator.java | 0.913057 | 0.406096 | LoopingActuator.java | starcoder |
package org.dizitart.no2.repository;
import org.dizitart.no2.collection.NitriteId;
import org.dizitart.no2.common.Lookup;
import org.dizitart.no2.common.NullOrder;
import org.dizitart.no2.common.RecordStream;
import org.dizitart.no2.common.SortOrder;
import org.dizitart.no2.filters.Filter;
import java.text.Collator;
... | nitrite/src/main/java/org/dizitart/no2/repository/Cursor.java | 0.865934 | 0.403273 | Cursor.java | starcoder |
package edu.kit.aquaplanning.model.ground;
import java.util.ArrayList;
import java.util.List;
/**
* Represents any kind of ground effect of a certain action.
* Can be one of the following:
* - an atomic effect (a single atom is added or deleted)
* - a numeric effect (a numeric atom (ground function) is updated)
... | src/main/java/edu/kit/aquaplanning/model/ground/Effect.java | 0.774583 | 0.561034 | Effect.java | starcoder |
package com.opengamma.financial.analytics.model.swaption;
import org.threeten.bp.Period;
import com.opengamma.OpenGammaRuntimeException;
import com.opengamma.analytics.financial.instrument.InstrumentDefinition;
import com.opengamma.analytics.financial.instrument.annuity.AnnuityCouponIborDefinition;
import com.opengam... | projects/OG-Financial/src/main/java/com/opengamma/financial/analytics/model/swaption/SwaptionUtils.java | 0.673836 | 0.544135 | SwaptionUtils.java | starcoder |
package org.osgi.framework.startlevel;
import org.osgi.annotation.versioning.ProviderType;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleReference;
import org.osgi.framework.FrameworkListener;
/**
* Query and modify the start level information for the framework. The start
* level object for the ... | org.osgi.framework/src/org/osgi/framework/startlevel/FrameworkStartLevel.java | 0.845656 | 0.437042 | FrameworkStartLevel.java | starcoder |
package org.dhbw.mosbach.ai.v2.provider;
import org.dhbw.mosbach.ai.base.Position;
import java.util.ArrayList;
public class Main {
public static void main(String[] args) {
ArrayList<Position> positions = new ArrayList<>();
Position pos1 = new Position(49.303717, 9.002668);
Position pos... | bundles/org.dhbw.mosbach.ai.v2.provider/src/org/dhbw/mosbach/ai/v2/provider/Main.java | 0.700895 | 0.706469 | Main.java | starcoder |
package io.flinkspector.core.quantify;
import io.flinkspector.core.quantify.assertions.TupleMatcher;
import org.apache.flink.api.java.tuple.Tuple;
import org.hamcrest.Matcher;
/**
* Enables the use of a {@link TupleMask} to map a {@link Tuple} to string keys.
* And then use these keys in combination with hamcrest's... | flinkspector-core/src/main/java/io/flinkspector/core/quantify/MatchTuples.java | 0.902375 | 0.519704 | MatchTuples.java | starcoder |
package turtle;
import java.util.HashMap;
import java.util.ResourceBundle;
import javafx.scene.effect.ColorAdjust;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import pen.LinePen;
import pen.Pen;
/**
*
* @author <NAME>
* Class that creates a turtle object with speed, location, and other s... | src/turtle/Turtle.java | 0.849457 | 0.420362 | Turtle.java | starcoder |
import java.util.Iterator;
import java.util.Set;
import java.util.TreeMap;
import java.util.Vector;
public class DoubleMap extends TreeMap<Double, Vector<String>> {
/**
* Retrieves a vector collection of g6codes whose keys differ from the provided key
* by less than {@see DoubleUtil.DOUBLE_EQUALITY_THRE... | DoubleMap.java | 0.879658 | 0.523177 | DoubleMap.java | starcoder |
package voltex;
import ij3d.AxisConstants;
import javax.media.j3d.*;
/**
* This class is a helper class whose main task is to create Geometry
* objects for a specified axis and direction.
* The returned GeometryArray objects are QuadArray objects.
*
* @author <NAME>
*/
public class GeometryCreator implements ... | src-plugins/3D_Viewer/src/main/java/voltex/GeometryCreator.java | 0.803019 | 0.53522 | GeometryCreator.java | starcoder |
package org.enso.interpreter.dsl;
import java.lang.annotation.*;
/**
* A class annotated with Builtin will auto-generate a corresponding {@link BuiltinType} known to
* the compiler and can be marked as @Builtin_Type in Enso standard library.
*
* <p>Consider annotating class {@code Foo}
*
* <pre>
* {@link Built... | lib/scala/interpreter-dsl/src/main/java/org/enso/interpreter/dsl/Builtin.java | 0.941217 | 0.41117 | Builtin.java | starcoder |
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import java.util.ArrayList;
import java.util.NoSuchElementException;
import static org.junit.jupiter.api.Assertions.*;
class DoublyLinkedListTest {
private DoublyLinkedList<Integer> emptyList;
private DoublyLinkedList<Integer> singl... | DoublyLinkedList/src/DoublyLinkedListTest.java | 0.863147 | 0.611672 | DoublyLinkedListTest.java | starcoder |
package de.coreengine.animation;
import de.coreengine.util.ByteArrayUtils;
import de.coreengine.util.Logger;
import javax.vecmath.Quat4f;
import javax.vecmath.Vector3f;
import java.util.Arrays;
import java.util.List;
/**
* Represents a animation that can be played by an animated model
*/
public class Animation {
... | src/main/java/de/coreengine/animation/Animation.java | 0.846578 | 0.534673 | Animation.java | starcoder |
package com.samsungxr;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CopyOnWriteArrayList;
import com.samsungxr.SXRMaterial.SXRShaderType;
import com.samsungxr.SXRMaterial.SXRShade... | SXR/SDK/sxrsdk/src/main/java/com/samsungxr/SXRNode.java | 0.943569 | 0.508361 | SXRNode.java | starcoder |
package org.kuali.rice.krms.impl.repository;
import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
import org.kuali.rice.krad.service.KRADServiceLocator;
import org.kuali.rice.krad.service.SequenceAccessorService;
import org.kuali.rice.krms.api.repository.typerelation.RelationshipType;
import org.kuali.rice.krm... | rice-middleware/krms/impl/src/main/java/org/kuali/rice/krms/impl/repository/TypeTypeRelationBo.java | 0.811788 | 0.449695 | TypeTypeRelationBo.java | starcoder |
package com.mpakhomov.algorithms.sort;
/**
* Starting from the beginning of the list, compare every adjacent pair, swap their position if they are not in the
* right order (the latter one is smaller than the former one). After each iteration, one less element (the last one)
* is needed to be compared until there ar... | src/main/java/com/mpakhomov/algorithms/sort/BubbleSort.java | 0.893068 | 0.456652 | BubbleSort.java | starcoder |
package menu.utils;
import com.jme3.math.Vector3f;
import java.util.ArrayList;
public class MeshUtils
{
/**
* Takes a list of vertices as input, ordered to form a triangle list
* (t1,t2,t3; u1,u2,u3...) and removes duplicates. Then return a list of
* indices that form the triangles. If the normals... | src/menu/utils/MeshUtils.java | 0.84572 | 0.531331 | MeshUtils.java | starcoder |
package readers;
import datastructures.FlowField;
import managers.FlowFieldManager;
import pipeline_components.Logger;
import java.util.ArrayList;
/**
* FlowFileReader reads the flow fields that were computed for a target dataset.
* More precisely, it reads the forward-and backward u-and v directional fields.
* Th... | Source/core/src/main/java/readers/FlowFileReader.java | 0.922495 | 0.41739 | FlowFileReader.java | starcoder |
package net.mchs_u.mc.aiwolf.common.starter.component;
import java.awt.GridLayout;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.swing.JPanel;
import org.aiwolf.common.data.Agent;
public class EstimateGraph extends JPanel{
private static final long serialVersionUID = 1L;
Li... | src/net/mchs_u/mc/aiwolf/common/starter/component/EstimateGraph.java | 0.521959 | 0.732831 | EstimateGraph.java | starcoder |
package com.stevotvr.aoc2020;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.stream.Collectors;
public class Day14 extends Solution {
@Override
public Object getPart1Solution() {
final HashMap<Long, Long> data = new HashMap<>();
char[] mask = new ... | aoc2020/src/com/stevotvr/aoc2020/Day14.java | 0.905105 | 0.418637 | Day14.java | starcoder |
package com.mapbox.geojson;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import com.google.auto.value.AutoValue;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.TypeAdapter;
import com.mapbox.geojson.gson.BoundingBoxDeserializer;
import... | services-geojson/src/main/java/com/mapbox/geojson/GeometryCollection.java | 0.953773 | 0.456228 | GeometryCollection.java | starcoder |
package com.ecdsa2;
import java.math.BigInteger;
public class ECC {
public static BigInteger NEUTRAL_VALUE = new BigInteger("-9999");
public static BigInteger P = new BigInteger("6277101735386680763835789423207666416083908700390324961279"); // as Private Key
public static BigInteger R = new BigInteger("6277101735... | k9mail/src/main/java/com/ecdsa2/ECC.java | 0.66628 | 0.67076 | ECC.java | starcoder |
package ch.epfl.rigel.gui;
import javafx.beans.property.ObjectProperty;
import org.junit.jupiter.api.Test;
import java.time.LocalDate;
import java.time.LocalTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupite... | test/ch/epfl/rigel/gui/DateTimeBeanTest.java | 0.884445 | 0.46035 | DateTimeBeanTest.java | starcoder |
package cgeo.geocaching.utils;
import java.util.HashSet;
import java.util.Set;
import org.junit.Test;
import static org.assertj.core.api.Java6Assertions.assertThat;
public class TextParserTest {
@Test
public void simple() {
final TextParser tp = new TextParser("te st");
assertThat(tp.ch()).i... | tests/src/cgeo/geocaching/utils/TextParserTest.java | 0.875175 | 0.896388 | TextParserTest.java | starcoder |
import java.util.*;
import java.util.stream.Collectors;
public class Grafo {
private Map<Integer, Set<Integer>> adj;
public Grafo() {
this.adj = new HashMap<>();
}
public Grafo(Map<Integer, Set<Integer>> adj) {
this.adj = adj.entrySet().stream()
... | Ficha05/src/Grafo.java | 0.845496 | 0.479077 | Grafo.java | starcoder |
package hso.autonomy.util.function;
import static org.junit.Assert.assertEquals;
import org.junit.Before;
import org.junit.Test;
import hso.autonomy.util.function.SinFunction;
import hso.autonomy.util.function.SupportPointFunction;
/**
* @author <NAME>
*
*/
public class SinFunctionTest
{
private SinFunction tes... | srcTest/hso/autonomy/util/function/SinFunctionTest.java | 0.804021 | 0.509642 | SinFunctionTest.java | starcoder |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.