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 matlabcontrol.link;
/**
*
* @since 4.2.0
* @author <a href="mailto:<EMAIL>"><NAME></a>
*/
class MatlabDoubleSparseMatrix extends MatlabDoubleMatrix<double[][]> {
private final SparseArray<double[]> _array;
MatlabDoubleSparseMatrix(int[] linearIndices, int[] rowIndices, int[] colIndices, double[] real, d... | src/matlabcontrol/link/MatlabDoubleSparseMatrix.java | 0.880193 | 0.550728 | MatlabDoubleSparseMatrix.java | starcoder |
package ca.eandb.jmist.framework.scene;
import ca.eandb.jmist.framework.IntersectionRecorder;
import ca.eandb.jmist.framework.Light;
import ca.eandb.jmist.framework.SceneElement;
import ca.eandb.jmist.framework.ShadingContext;
import ca.eandb.jmist.framework.SurfacePoint;
import ca.eandb.jmist.math.Box3;
import ca.ean... | jmist-core/src/main/java/ca/eandb/jmist/framework/scene/NullSceneElement.java | 0.860369 | 0.410579 | NullSceneElement.java | starcoder |
package org.ensor.data.atom;
/**
* An atom is the primitive abstract data container for events. It consists
* of a type and derived classes hold the actual data associated with the atom.
* @author Jon
*/
public abstract class Atom {
private final int mType;
/**
* This constant indicates that the obj... | src/main/java/org/ensor/data/atom/Atom.java | 0.927454 | 0.535038 | Atom.java | starcoder |
package org.openecomp.sdc.translator.datatypes.heattotosca.unifiedmodel.consolidation;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
public class FileComputeConsolidationData {
//key - compute node type name (vm_type)
private final Map<String, TypeComputeC... | openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/unifiedmodel/consolidation/FileComputeConsolidationData.java | 0.837088 | 0.511229 | FileComputeConsolidationData.java | starcoder |
package android.net;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import androidx.test.filters.SmallTest;
import androidx.test.runner.AndroidJUn... | tests/net/java/android/net/MacAddressTest.java | 0.833833 | 0.645609 | MacAddressTest.java | starcoder |
package buildingsmart.ifc;
import buildingsmart.io.Attribute;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NonNull;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/**
* A point defined by its coordinates in a two or three dimensional rectangular
* Cartesian... | src/main/java/buildingsmart/ifc/IfcCartesianPoint.java | 0.915092 | 0.452354 | IfcCartesianPoint.java | starcoder |
import java.io.*;
import java.util.*;
public class Solution {
// The first triangle number with over 1000 divisors is 842161320 which has 1024 factors
static int MAX_FACTORS = 1024;
// And the number 842161320 is the sum of 41040 numbers, i.e., 41040 * 41041 / 2 = 842161320
static int MAX_TRIANGLE_NUM... | Contests/Project Euler/12 - Highly Divisible Triangular Number/Solution.java | 0.671147 | 0.497864 | Solution.java | starcoder |
package org.andreystarikov.ReportGenerator;
import java.util.ArrayList;
public class ColumnFormatter {
/**
* Разбивает одну входящую строку на список коротких, длинной, равной входящему параметру.
*
* @param input входящая строка
* @param limit определяет длину строки в списке
* @return ... | src/main/java/org/andreystarikov/ReportGenerator/ColumnFormatter.java | 0.554712 | 0.414306 | ColumnFormatter.java | starcoder |
package com.github.typeson;
import com.googlecode.totallylazy.numbers.Numbers;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.function.Function;
public abstract class IntegerValue<T extends TinyType<BigInteger, T>> extends TinyType<BigInteger, T> implements IntegerValueOperations<T>, Deci... | src/com/github/typeson/IntegerValue.java | 0.721743 | 0.643595 | IntegerValue.java | starcoder |
package com.josedab.interviewbit.binarySearch.painterPartition;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.List;
/**
* You have to paint N boards of length {A0, A1, A2, A3 … AN-1}.
* There are K painters available and you are also given how much time a painter takes to paint 1 unit of bo... | src/main/java/com/josedab/interviewbit/binarySearch/painterPartition/PainterPartitionProblemOfficial.java | 0.889165 | 0.503723 | PainterPartitionProblemOfficial.java | starcoder |
package org.jgrapht.alg.shortestpath;
import java.lang.reflect.*;
import java.util.*;
import org.jgrapht.*;
import org.jgrapht.alg.util.*;
/**
* The Bellman-Ford algorithm.
*
* <p>
* Computes shortest paths from a single source vertex to all other vertices in a weighted graph.
* The Bellman-Ford algorithm suppo... | jgrapht-master/jgrapht-core/src/main/java/org/jgrapht/alg/shortestpath/BellmanFordShortestPath.java | 0.959931 | 0.41324 | BellmanFordShortestPath.java | starcoder |
package seedu.address.model.person;
import static java.util.Objects.requireNonNull;
import static seedu.address.commons.util.AppUtil.checkArgument;
/**
* Represents a Person's address in the address book.
* Guarantees: immutable; is valid as declared in {@link #isValidAddress(String)}
*/
public class Address {
... | src/main/java/seedu/address/model/person/Address.java | 0.943073 | 0.409044 | Address.java | starcoder |
package org.jgrapht.io;
import org.jgrapht.*;
import java.io.*;
import java.util.*;
import java.util.Map.*;
import java.util.regex.*;
/**
* Exports a graph into a DOT file.
*
* <p>
* For a description of the format see <a href="http://en.wikipedia.org/wiki/DOT_language">
* http://en.wikipedia.org/wiki/DOT_langu... | jgrapht-1.3.0/source/jgrapht-io/src/main/java/org/jgrapht/io/DOTExporter.java | 0.902867 | 0.452778 | DOTExporter.java | starcoder |
package com.telenav.nodeflow;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
/**
* Data structure for storing user data.
* @param <T> data type
*/
public class Node<T> {
private T data;
private int depth;
private int index;
private Node<T> parent;
private List<... | nodeflow/src/main/java/com/telenav/nodeflow/Node.java | 0.916138 | 0.568236 | Node.java | starcoder |
package club.tilitili.schedule.util;
import club.tilitili.schedule.exception.AssertException;
import java.util.Objects;
public class Asserts {
public Asserts() {
}
public static void isTrue(boolean expression, String message) {
if (!expression) {
throw new AssertException(message);
... | src/main/java/club/tilitili/schedule/util/Asserts.java | 0.715623 | 0.485295 | Asserts.java | starcoder |
package se.claremont.taf.core.support.tableverification;
import se.claremont.taf.core.logging.LogLevel;
import se.claremont.taf.core.support.SupportMethods;
import se.claremont.taf.core.testcase.TestCase;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/**
* TableData class for veri... | src/main/java/se/claremont/taf/core/support/tableverification/TableData.java | 0.833562 | 0.425546 | TableData.java | starcoder |
package org.datum.generators;
import static org.datum.algorithm.Algorithm.*;
import static org.datum.generators.RandomGeneratorUtils.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.function.Supplier;
import java.util.regex.Pa... | core/src/main/java/org/datum/generators/LastNameGenerator.java | 0.742048 | 0.450843 | LastNameGenerator.java | starcoder |
package org.manuel.mysportfolio.transformers.match;
import io.github.manuelarte.mysportfolio.model.documents.match.Match;
import io.github.manuelarte.mysportfolio.model.documents.match.TeamType;
import io.github.manuelarte.mysportfolio.model.documents.match.events.MatchEvent;
import io.github.manuelarte.mysportfolio.m... | src/main/java/org/manuel/mysportfolio/transformers/match/MatchDtoToMatchTransformer.java | 0.7324 | 0.436742 | MatchDtoToMatchTransformer.java | starcoder |
package org.apache.hadoop.hive.ql.exec.vector.expressions;
import org.apache.hadoop.hive.ql.exec.vector.VectorExpressionDescriptor;
import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch;
/**
* This class represents an Or expression. This applies short circuit optimization.
*/
public class FilterExprOrExpr... | ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FilterExprOrExpr.java | 0.824956 | 0.506713 | FilterExprOrExpr.java | starcoder |
package com.twu.biblioteca.view;
import com.twu.biblioteca.model.Book;
import com.twu.biblioteca.model.Movie;
import com.twu.biblioteca.view.ListBooksScreen;
import com.twu.biblioteca.view.ListMoviesScreen;
import com.twu.biblioteca.view.Screen;
import org.junit.Before;
import org.junit.Test;
import java.time.Year;
... | test/com/twu/biblioteca/view/ListMoviesScreenTest.java | 0.756987 | 0.427337 | ListMoviesScreenTest.java | starcoder |
package com.xr.base.core.util;
import java.math.BigDecimal;
/**
* @author <NAME>
* @summary 数学计算工具类
* @time 2018/4/1 17:14
*/
public class ArithUtil {
//默认运算精度
private static final int DEFAULT_SCALE = 10;
private ArithUtil() {
}
/**
* 提供精确的加法运算。
*
* @param v1 被加数
* @param v2 加数
* @retu... | ms-base/ms-base-common/src/main/java/com/xr/base/core/util/ArithUtil.java | 0.685844 | 0.419886 | ArithUtil.java | starcoder |
package com.myxh.leetcode.array;
/**
* There are two sorted arrays nums1 and nums2 of size m and n respectively.
* <p>
* Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).
* <p>
* You may assume nums1 and nums2 cannot be both empty.
* <p>
* Example 1:
* <p>
* num... | app/src/main/java/com/myxh/leetcode/array/L4_MedianOfTwoSortedArrays.java | 0.87335 | 0.600657 | L4_MedianOfTwoSortedArrays.java | starcoder |
package com.adamantite.es.querybuilder;
import static com.adamantite.es.querybuilder.QueryDSLTypeExtractor.esQuerybuilderDir;
import static com.adamantite.es.querybuilder.QueryDSLTypeExtractor.esVersion;
import static com.adamantite.es.querybuilder.QueryDSLTypeExtractor.classLoader;
import static org.junit.Assert.asse... | test/com/adamantite/es/querybuilder/QueryDSLTypeExtractorTest.java | 0.759404 | 0.406155 | QueryDSLTypeExtractorTest.java | starcoder |
package DGP.CJLU.Experiment5.Lab1;
/**
* Given input {4371, 1223, 6173, 4199, 4344, 9679, 1989} and a hash function h(x) = x % 11 ,collision should be resolved by the following solutions
* a) Draw the results with the following different hash tables, calculate the average search lengths in successful searches and lo... | src/DGP/CJLU/Experiment5/Lab1/Main.java | 0.862656 | 0.588594 | Main.java | starcoder |
package org.projog.clp;
/**
* Contains methods for performing basic numeric operations which handle overflow errors by rounding down to
* {@link Long.MAX_VALUE} or up to {@link Long.MIN_VALUE}.
*/
final class MathUtils {
private MathUtils() {
}
/**
* Returns the sum of the arguments, rounding up or do... | src/main/java/org/projog/clp/MathUtils.java | 0.926354 | 0.437163 | MathUtils.java | starcoder |
package com.globant.fit;
/**
* Exercise Globant fit: Suppose we have a binary tree of nodes with numeric
* values, with nodes in no particular order. We would like to find the maximum
* difference between any ancestor node in the tree and any of that ancestor's
* descendant nodes.
*
* @author <NAME>
* @version... | src/main/java/com/globant/fit/App.java | 0.840652 | 0.535341 | App.java | starcoder |
package maspack.matrix;
/**
* Implements a 6 x 6 matrix block using a single Matrix6d object.
*/
public class Matrix6dBlock extends Matrix6d implements MatrixBlock {
protected MatrixBlock myNext;
protected MatrixBlock myDown;
protected int myBlkRow;
protected int myBlkCol;
protected int myRowOff;
... | src/maspack/matrix/Matrix6dBlock.java | 0.878972 | 0.40539 | Matrix6dBlock.java | starcoder |
package SFE.Compiler;
import java.io.PrintWriter;
import java.util.Vector;
/**
* A class for representing input statement for the final output circuit.
*/
public class InputStatement extends Statement implements OutputWriter, Optimize {
//~ Instance fields -------------------------------------------------------... | InterestCastApp/src/SFE/Compiler/InputStatement.java | 0.839537 | 0.495239 | InputStatement.java | starcoder |
package io.pravega.common.concurrent;
import io.pravega.common.util.ReusableLatch;
import java.util.*;
import java.util.concurrent.*;
/**
* A test executor that provides deterministic scheduling
*
* Usage:
* set environment variable $DETERMINISTIC_TEST to an integer
* By providing an identical number, the tasks ... | common/src/main/java/io/pravega/common/concurrent/ScheduledThreadPoolExecutorForTesting.java | 0.937182 | 0.557183 | ScheduledThreadPoolExecutorForTesting.java | starcoder |
package com.example.doun.chapter17containers.performancetest;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* Created by Doun on 2017/9/1.
*/
public class MyIntVector {
private int[] vector;
private int size = 0;
private int maxsize = 0;
public MyIntVector() {
... | Chapter17Containers/app/src/main/java/com/example/doun/chapter17containers/performancetest/MyIntVector.java | 0.527317 | 0.426142 | MyIntVector.java | starcoder |
package com.github.avalon.dimension.biome;
/**
* Data about the biome are send to the client. Currently there is not that much usage for this
* because there is no way to generate the world but still it has use in default world because world
* should have at least one biome.
*
* @author Horizon
* @version 1.0
*... | src/main/java/com/github/avalon/dimension/biome/BiomeData.java | 0.894657 | 0.490785 | BiomeData.java | starcoder |
package fwcd.fructose.geometry;
import fwcd.fructose.draw.DrawGraphics;
/**
* Represents a line segment with a fixed start
* and end position. If you need an unbounded line,
* check out {@link Straight2D}.
*
* @author Fredrik
*
*/
public class LineSeg2D extends Path2D {
private static final long serialVersio... | src/main/java/fwcd/fructose/geometry/LineSeg2D.java | 0.945033 | 0.54353 | LineSeg2D.java | starcoder |
package com.whirvex.cmd.input;
/**
* Signals that an error has occurred in an {@link InputParser} while parsing
* command input.
*/
public class InputException extends IllegalArgumentException {
private static final long serialVersionUID = 4592325200912430878L;
private final InputIterator input;
/**
* Const... | cmd/src/main/java/com/whirvex/cmd/input/InputException.java | 0.92602 | 0.419053 | InputException.java | starcoder |
package io.github.kuroppoi.qtoolkit.shared;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
public class DataBuffer {
private final ByteBuffer buffer;
public DataBuffer() {
this(16777213); // TODO bad
}
... | qtoolkit-shared/src/main/java/io/github/kuroppoi/qtoolkit/shared/DataBuffer.java | 0.634883 | 0.442576 | DataBuffer.java | starcoder |
public class Train {
private int trainNumber;
private String destination;
private int arrivalTime;
private int transferTime;
private Train next;
private Train previous;
/**
* Default constructor w/o parameters
*/
public Train() {
this.trainNumber = 0;
this.des... | Data Structures and Algorithms (Java)/Train Stations (LinkedLists)/src/Train.java | 0.919656 | 0.453383 | Train.java | starcoder |
package com.pmihaylov;
import sun.jvm.hotspot.utilities.AssertionFailure;
import java.util.Arrays;
import java.util.Collections;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
public class RulesGraph {
private static final Rule EMPTY_BAG ... | 2020/day07/src/com/pmihaylov/RulesGraph.java | 0.889583 | 0.436502 | RulesGraph.java | starcoder |
package eu.dariolucia.ccsds.tmtc.cop1.fop;
public enum FopState {
/**
* Normal state of the state machine when there are no recent errors on
* the link and no incidents have occurred leading to flow control problems
*/
S1("Active"),
/**
* The state machine is in the 'Retransmit without ... | eu.dariolucia.ccsds.tmtc/src/main/java/eu/dariolucia/ccsds/tmtc/cop1/fop/FopState.java | 0.719482 | 0.435301 | FopState.java | starcoder |
package xor.core;
import xor.core.Cells.CellType;
public class Player {
enum PlayerState {
ALIVE,
EXPLODING,
DYING,
DEAD,
TELEPORTING;
}
enum PlayerType {
HERB(CellType.HERB),
PIP(CellType.PIP);
public final CellType cellType;
public final int code = this.ordinal();
P... | prospector/core/src/main/java/xor/core/Player.java | 0.792304 | 0.468608 | Player.java | starcoder |
package q1400;
import java.util.Arrays;
import org.junit.runner.RunWith;
import util.runner.Answer;
import util.runner.LeetCodeRunner;
import util.runner.TestData;
import util.runner.data.DataExpectation;
/**
* [Medium] 1366. Rank Teams by Votes
* https://leetcode.com/problems/rank-teams-by-votes/
*
* In a specia... | src/main/java/q1400/Q1366_RankTeamsByVotes.java | 0.851783 | 0.438064 | Q1366_RankTeamsByVotes.java | starcoder |
package org.jfree.chart.renderer.xy;
import java.awt.GradientPaint;
import java.awt.Graphics2D;
import java.awt.Paint;
import java.awt.geom.GeneralPath;
import java.awt.geom.Point2D;
import java.awt.geom.Point2D.Float;
import java.awt.geom.Rectangle2D;
import java.util.ArrayList;
import java.util.List;
import org.jfre... | org/jfree/chart/renderer/xy/XYSplineRenderer.java | 0.807574 | 0.463141 | XYSplineRenderer.java | starcoder |
package problem.bitString.KSPenalty;
import genetic.gene.GeneBinary;
import utils.Funcs;
/*
* # Bests :11 [3 ]Profit: 1561,000000 Height: 1352,000000 Fitness: 1561,000000
* Genome:
* 1110000111001111111110011110110010111011111100010111011100111111001011010111011010110000001101110101
* [1 ]Profit: 1561,000000 Heigh... | SMUGA/src/problem/bitString/KSPenalty/K100.java | 0.688154 | 0.462109 | K100.java | starcoder |
package org.eurocarbdb.application.glycanbuilder;
import java.util.*;
import java.text.*;
import java.io.*;
import java.awt.*;
import java.awt.geom.*;
import java.awt.event.*;
import java.awt.datatransfer.*;
import java.awt.image.*;
import javax.swing.*;
import org.w3c.dom.*;
import static org.eurocarbdb.application.... | src/org/eurocarbdb/application/glycanbuilder/GlycanRendererAWT.java | 0.812161 | 0.498535 | GlycanRendererAWT.java | starcoder |
package ca.eandb.jmist.framework.material;
import ca.eandb.jmist.framework.Material;
import ca.eandb.jmist.framework.Medium;
import ca.eandb.jmist.framework.ScatteredRay;
import ca.eandb.jmist.framework.SurfacePoint;
import ca.eandb.jmist.framework.color.Color;
import ca.eandb.jmist.framework.color.ColorUtil;
import c... | jmist-core/src/main/java/ca/eandb/jmist/framework/material/ShadingNormalAdapterMaterial.java | 0.896597 | 0.542984 | ShadingNormalAdapterMaterial.java | starcoder |
package mnm.mods.util;
import com.google.gson.annotations.SerializedName;
import java.util.Random;
/**
* Represents a color and provides an easy way to convert to and from html color
* codes. A few default colors have been provided.
*/
public class Color {
public static final Color BLACK = of(0xff000000);
... | src/main/java/mnm/mods/util/Color.java | 0.957437 | 0.503479 | Color.java | starcoder |
package info.piwai.toohardforyou.core.wall;
import static forplay.core.ForPlay.*;
import info.piwai.toohardforyou.core.Constants;
import info.piwai.toohardforyou.core.brick.Brick;
import info.piwai.toohardforyou.core.brick.BrickFactory;
public class Wall {
private final Brick[][] bricks = new Brick[Constants.WAL... | toohardforyou-core/src/main/java/info/piwai/toohardforyou/core/wall/Wall.java | 0.721547 | 0.438244 | Wall.java | starcoder |
package threeChess.agents;
import threeChess.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Random;
/**
* A naively implemented three-ply maximax agent that uses the default Board implementation.
*
* This agent is _slow_. It takes about 300x as much time per move a... | src/threeChess/agents/NaiveThreePlyAgent.java | 0.891793 | 0.407864 | NaiveThreePlyAgent.java | starcoder |
package meet_eat.server.service;
import java.security.SecureRandom;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.function.Supplier;
import java.util.stream.Collectors;
/**
* Represents a {@link Supplier} class for {@link meet_eat.data.entity.user.Password} compati... | src/main/java/meet_eat/server/service/PasswordValueSupplier.java | 0.933507 | 0.472805 | PasswordValueSupplier.java | starcoder |
package com.harmonygames.engine.math;
public class Vector2f {
public static final Vector2f ZERO = new Vector2f(0, 0);
public float x;
public float y;
public Vector2f() {
this(0f, 0f);
}
public Vector2f(Vector2f r) {
this.x = r.x;
this.y = r.y;
}
public Vecto... | HarmonyEngine/src/main/java/com/harmonygames/engine/math/Vector2f.java | 0.924142 | 0.753761 | Vector2f.java | starcoder |
package saltaa;
import java.util.Arrays;
import java.util.List;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
/**
* Tests crypto_box_x functions.
*/
@RunWith(Parameterized.class)
public class BoxTest {
private SaltLib lib;
@Par... | src-test/saltaa/BoxTest.java | 0.65202 | 0.405272 | BoxTest.java | starcoder |
package ubic.gemma.model.genome.biosequence;
import java.util.*;
@SuppressWarnings({ "unused", "WeakerAccess" }) // Possible external use
public class SequenceType implements java.io.Serializable, Comparable<SequenceType> {
/**
* Represents the target sequence provided by the manufacturer.
*/
public... | gemma-core/src/main/java/ubic/gemma/model/genome/biosequence/SequenceType.java | 0.922626 | 0.681091 | SequenceType.java | starcoder |
package hr.fer.zemris.java.graphics.raster;
public class BWRasterMem implements BWRaster {
private int width;
private int height;
private boolean[][] pixels;
private boolean flipMode = false;
/**
* Lets the user specify raster's size and initially turns all
* of it's pixels off.
* @param width of the rast... | opjj/DZ2/src/hr/fer/zemris/java/graphics/raster/BWRasterMem.java | 0.889433 | 0.488771 | BWRasterMem.java | starcoder |
package com.matija.medium;
import java.util.*;
public class TwoPluses {
//"G G G G G G G G",
//"G B G B G G B G",
//"G B G B G G B G",
//"G G G G G G G G",
//"G B G B G G B G",
//"G G G G G G G G",
//"G B G B G G B G",
//"G G G G G G G G"
static class Plus {
int length;
Set<String> pairs;
... | hackerrank/src/com/matija/medium/TwoPluses.java | 0.631367 | 0.538923 | TwoPluses.java | starcoder |
package de.jungblut.classification.eval;
import static org.junit.Assert.assertEquals;
import java.util.Arrays;
import org.junit.Test;
import de.jungblut.classification.ClassifierFactory;
import de.jungblut.classification.eval.Evaluator.EvaluationResult;
import de.jungblut.classification.knn.KNearestNeighbours;
impo... | test/de/jungblut/classification/eval/EvaluatorTest.java | 0.888445 | 0.414247 | EvaluatorTest.java | starcoder |
package com.section6.exercises.PoolArea;
/*
The Swimming Company has asked you to write an application that calculates the volume of cuboid shaped pools.
1. Write a class with the name Rectangle. The class needs two fields (instance variable) with name width and length both of type double.
The class needs to have one... | src/com/section6/exercises/PoolArea/Main.java | 0.761139 | 0.620075 | Main.java | starcoder |
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* Generate All Possible Expressions That Evaluate To The Given Target Value
Problem Statement:
You are given a string s of length n, containing only numerical characters ('0' - '9'). You are also given a non-negative number target.
Yo... | src/GenerateAllExpressions.java | 0.842183 | 0.855066 | GenerateAllExpressions.java | starcoder |
package com.force.i18n.settings;
import java.util.*;
import java.util.Map.Entry;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.ImmutableSortedMap;
/**
* Responsible for providing property file data in a space efficient way. By using {@link SkinnyMapPropertyFileData}'s the overhead ... | src/main/java/com/force/i18n/settings/SkinnyMapPropertyFileData.java | 0.925915 | 0.427994 | SkinnyMapPropertyFileData.java | starcoder |
package org.locationtech.jts.precision;
/**
* Determines the maximum number of common most-significant
* bits in the mantissa of one or numbers.
* Can be used to compute the double-precision number which
* is represented by the common bits.
* If there are no common bits, the number computed is 0.0.
*
* @version... | src/main/java/org/locationtech/jts/precision/CommonBits.java | 0.887692 | 0.603406 | CommonBits.java | starcoder |
package simulation;
import grid.Grid;
import javafx.scene.paint.Color;
import utils.Cell;
import java.util.Random;
/**
* Class that represents the simulation.Percolation simulation.
* <p>
* States: blocked(0), open(1), percolated(1)
*
* @author <NAME>
*/
public class Percolation extends Simulation {
private... | src/simulation/Percolation.java | 0.899754 | 0.628635 | Percolation.java | starcoder |
package context.estimation;
import java.util.ArrayList;
import java.util.List;
import java.util.ListIterator;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
import org.apache.commons.lang3.tuple.Pair;
import agent.base.Agent;
import context.Context;
import context.ContextInfo;
... | src/context/estimation/ContextEstimationImpl.java | 0.886113 | 0.489442 | ContextEstimationImpl.java | starcoder |
package io.klerch.alexa.state.handler;
import com.amazon.speech.speechlet.Session;
import io.klerch.alexa.state.model.*;
import io.klerch.alexa.state.utils.AlexaStateException;
import java.util.Collection;
import java.util.Map;
import java.util.Optional;
/**
* A state handler is an object which encapsulates persist... | src/main/java/io/klerch/alexa/state/handler/AlexaStateHandler.java | 0.891843 | 0.441974 | AlexaStateHandler.java | starcoder |
package org.wms.model.order;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
... | test/org/wms/model/order/OrderUnitTest.java | 0.631026 | 0.560223 | OrderUnitTest.java | starcoder |
public class MyMain {
// Calculate the probability of rolling at least one 6 when rolling
// six dice. Uses 10000 trials.
// Returns in the answer as a double corresponding to the percentage
// For example, 75.5% would be 75.5
public static double probabilityOneSix() {
int b = 0;
d... | src/main/java/MyMain.java | 0.68056 | 0.454109 | MyMain.java | starcoder |
package cl.uchile.dcc.scrabble.model.utils;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
/**
* Class that provides functionalities for binaries.
* @author <NAME>.
*/
public final class BinaryUtilities {
/**
* Private constructor to avoid instance of this class.
*/
privat... | src/main/java/cl/uchile/dcc/scrabble/model/utils/BinaryUtilities.java | 0.937648 | 0.475849 | BinaryUtilities.java | starcoder |
package org.apache.bval.jsr;
import javax.validation.ConstraintViolation;
import javax.validation.Valid;
import javax.validation.ValidationException;
import javax.validation.Validator;
import java.util.Set;
/**
* Per the bean validation spec, {@link Valid} is not honored by the
* {@link #validateProperty(Object, S... | bval-jsr/src/main/java/org/apache/bval/jsr/CascadingPropertyValidator.java | 0.930229 | 0.496094 | CascadingPropertyValidator.java | starcoder |
package repast.simphony.space.grid;
import java.util.Arrays;
/**
* Determines whether or not a particular target object is in the Von Neumann
* neighborhood of a particular source. This works with 1D, 2D and 3D grids
* only.
*
* @author <NAME>
* @version $Revision$ $Date$
*/
public class VNCo... | repast.simphony.core/src/repast/simphony/space/grid/VNContains.java | 0.768993 | 0.432842 | VNContains.java | starcoder |
package dev.robocode.tankroyale.botapi;
/**
* Game setup retrieved when game is started.
*/
@SuppressWarnings("unused")
public final class GameSetup {
/**
* Game type, e.g. "melee"..
*/
private final String gameType;
/**
* Width of the arena measured in units.
*/
private final i... | bot-api/java/src/main/java/dev/robocode/tankroyale/botapi/GameSetup.java | 0.905317 | 0.402774 | GameSetup.java | starcoder |
package org.apache.tamaya.format;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
/**
* Data that abstracts the data read from a configuration resources using a certain format. The data can be divided
* into different sections, similar to ini-files. Herebey different sections the best map to e... | modules/formats/src/main/java/org/apache/tamaya/format/ConfigurationData.java | 0.914367 | 0.412648 | ConfigurationData.java | starcoder |
package com.vaani.leetcode.binary_search;
import java.util.PriorityQueue;
/**
* https://leetcode.com/problems/the-k-weakest-rows-in-a-matrix/
* 1337. The K Weakest Rows in a Matrix
* Easy
* <p>
* Given a m * n matrix mat of ones (representing soldiers) and zeros (representing civilians), return the indexes of th... | java/leetcode/src/main/java/com/vaani/leetcode/binary_search/TheKWeakestRowsInAMatrix.java | 0.917649 | 0.529446 | TheKWeakestRowsInAMatrix.java | starcoder |
package de.smatterling.sorting;
import java.util.Comparator;
/**
* Utility functions for building and combining {@link Comparator} objects.
*/
public class Comparators {
/**
* Creates a comparator which compares elements using the provided comparators. The first comparator has higher
* priority than ... | src/main/java/de/smatterling/sorting/Comparators.java | 0.958972 | 0.528898 | Comparators.java | starcoder |
package com.rawva.structures.graphs;
/**
* A weighted graph is a type of graph in which weights are associated with
* edges. An edge weight is an object that indicates some value associated with
* an edge.
*
* @author <NAME>
*
* @param <V>
* the type of elements (vertices) in this graph
* @param <... | src/com/rawva/structures/graphs/WeightedGraph.java | 0.925272 | 0.542924 | WeightedGraph.java | starcoder |
package algorithms.compGeometry;
import algorithms.imageProcessing.util.PairIntWithIndex;
import algorithms.util.PairInt;
/**
* adapted from
* https://code.google.com/p/two-point-correlation/source/browse/src/main/java/algorithms/compGeometry/LinesAndAngles.java
* under MIT License (MIT), <NAME> 2013
*
*/
publ... | src/algorithms/compGeometry/LinesAndAngles.java | 0.90492 | 0.674476 | LinesAndAngles.java | starcoder |
package com.compomics.util.math.statistics;
/**
* This class represents a statistical distribution model like a Gaussian
* distribution.
*
* @author <NAME>
*/
public interface Distribution {
/**
* Returns the density function value at a given position.
*
* @param x the position ... | src/main/java/com/compomics/util/math/statistics/Distribution.java | 0.910826 | 0.669669 | Distribution.java | starcoder |
package org.cesiumjs.cs.scene.options;
import jsinterop.annotations.*;
import org.cesiumjs.cs.core.*;
import org.cesiumjs.cs.js.JsObject;
import org.cesiumjs.cs.scene.Camera;
/**
* @author <NAME> aka iSergio
*/
@JsType(isNative = true, namespace = JsPackage.GLOBAL, name = "Object")
public class CameraFlyToOptions {... | cesiumjs4gwt-main/src/main/java/org/cesiumjs/cs/scene/options/CameraFlyToOptions.java | 0.839734 | 0.438124 | CameraFlyToOptions.java | starcoder |
* Description: Exceptions code utilization.
* Main Focus:
*
*/
package benchmarks.micro;
public class Exceptions {
private int[] smallArray = new int[1];
private static final int ARITHM_DOUBLE_ITERS = 20000;
/**
* Three following examples do the same arithmetics on double, but
* - arithmDouble... | benchmarks/micro/Exceptions.java | 0.734215 | 0.448426 | Exceptions.java | starcoder |
package org.lpe.common.util;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Properties;
import java.util.StringTokenizer;
/**
* Utility class for string operations.
*
* @author <NAME>, <NAME>
*
*/
public final class LpeStringUtils {
/**
* private constructor ... | org.lpe.common.utils/src/org/lpe/common/util/LpeStringUtils.java | 0.883506 | 0.406509 | LpeStringUtils.java | starcoder |
package edu.neu.coe.info6205.sort.simple;
import edu.neu.coe.info6205.sort.BaseHelper;
import edu.neu.coe.info6205.sort.Helper;
import edu.neu.coe.info6205.sort.SortWithHelper;
import edu.neu.coe.info6205.util.Config;
import java.util.ArrayList;
public class InsertionSort<X extends Comparable<X>> extends SortWithHel... | src/main/java/edu/neu/coe/info6205/sort/simple/InsertionSort.java | 0.709824 | 0.482673 | InsertionSort.java | starcoder |
package com.programming.tree;
import java.util.ArrayList;
public class MaxPathInUndirectedBinaryTree {
static class Node {
Node parent;
Node leftChild;
Node rightChild;
int value;
public Node(Node leftChild, Node rightChild, int value) {
this.leftChild = leftChild;
this.rightChild = rightChild;
... | src/main/java/com/programming/tree/MaxPathInUndirectedBinaryTree.java | 0.613121 | 0.478468 | MaxPathInUndirectedBinaryTree.java | starcoder |
package com.bluegosling.concurrent.executors;
import com.bluegosling.concurrent.fluent.FluentExecutorService;
import com.bluegosling.concurrent.fluent.FluentFuture;
import com.bluegosling.concurrent.fluent.SettableRunnableFluentFuture;
import java.util.concurrent.Callable;
import java.util.concurrent.Executor;
/**
... | src/com/bluegosling/concurrent/executors/SerializingExecutor.java | 0.901526 | 0.471284 | SerializingExecutor.java | starcoder |
package nl.tudelft.broccoli.core;
import nl.tudelft.broccoli.core.grid.Direction;
import nl.tudelft.broccoli.core.grid.Tile;
import nl.tudelft.broccoli.core.grid.Tileable;
import nl.tudelft.broccoli.core.grid.TileableListener;
import nl.tudelft.broccoli.core.track.Track;
/**
* This tileable teleports a {@link Marble... | broccoli-core/src/main/java/nl/tudelft/broccoli/core/Teleporter.java | 0.933997 | 0.431764 | Teleporter.java | starcoder |
package net.minecraftforge.event.terraingen;
import net.minecraft.world.biome.BiomeProvider;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.eventhandler.Cancelable;
import net.minecraftforge.fml.common.eventhandler.Event;
import net.minecraft.world.gen.layer.GenLayer;
import net.... | build/tmp/recompileMc/sources/net/minecraftforge/event/terraingen/WorldTypeEvent.java | 0.779322 | 0.409339 | WorldTypeEvent.java | starcoder |
import java.util.Comparator;
/**
* Data for a joint in a skeleton for a tracked user.
*/
public class Joint
{
/**
* The total number of joints that are tracked by the sensor.
*/
public static final int NUM_JOINTS = 15;
/**
* The head joint (centre of the head).
*/
public static f... | book-scenarios/chapter12/stick-figure/Joint.java | 0.873485 | 0.505005 | Joint.java | starcoder |
package java.awt.image;
import java.awt.geom.Rectangle2D;
import java.awt.geom.Point2D;
import java.awt.RenderingHints;
/**
* This interface describes single-input/single-output
* operations performed on <CODE>BufferedImage</CODE> objects.
* It is implemented by <CODE>AffineTransformOp</CODE>,
* <CODE>ConvolveOp<... | analyzed_libs/jdk1.6.0_06_src/java/awt/image/BufferedImageOp.java | 0.943595 | 0.609989 | BufferedImageOp.java | starcoder |
package arc.math.geom;
import arc.struct.Seq;
import arc.func.Intc2;
import arc.util.pooling.Pool;
import arc.util.pooling.Pools;
/**
* Returns a list of points at integer coordinates for a line on a 2D grid, using the Bresenham algorithm.
* <p>
* <p>
* Instances of this class own the returned array of points and... | arc-core/src/arc/math/geom/Bresenham2.java | 0.920727 | 0.622431 | Bresenham2.java | starcoder |
package com.github.jbapple.libfilter;
import java.lang.Math;
import java.util.ArrayList;
import java.util.Arrays;
// TODO: Comparable, Serialeable
/**
* TaffyCuckooFilter is a filter based on the paper "Stretching your data with taffy
* filters". It can grow when it becomes full without affecting the false positive... | java/libfilter/src/main/java/com/github/jbapple/libfilter/TaffyCuckooFilter.java | 0.565779 | 0.437103 | TaffyCuckooFilter.java | starcoder |
package pl.sudokusolver.recognizerlib.data;
import com.google.common.collect.Lists;
import org.opencv.core.*;
import org.opencv.ml.Ml;
import pl.sudokusolver.recognizerlib.filters.BlurFilter;
import pl.sudokusolver.recognizerlib.filters.ResizeFilter;
import pl.sudokusolver.recognizerlib.filters.ToGrayFilter;
import pl... | Web/RecognizerLib/src/main/java/pl/sudokusolver/recognizerlib/data/LearnData.java | 0.752286 | 0.408631 | LearnData.java | starcoder |
package JUnitTests;
import gridworld.actor.*;
import gridworld.grid.BoundedGrid;
import gridworld.grid.Location;
import gridworld.world.PacmanWorld;
import org.junit.jupiter.api.Test;
import project.Main;
import project.Mechanics;
import java.awt.*;
import java.util.ArrayList;
import static org.junit.jupiter.api.Ass... | Pacman/src/JUnitTests/CasperTest.java | 0.561455 | 0.532547 | CasperTest.java | starcoder |
package org.wmn4j.representation.geometric;
import org.wmn4j.mir.PatternPosition;
import org.wmn4j.notation.Chord;
import org.wmn4j.notation.Durational;
import org.wmn4j.notation.Measure;
import org.wmn4j.notation.Note;
import org.wmn4j.notation.Score;
import org.wmn4j.notation.access.Position;
import org.wmn4j.notati... | src/main/java/org/wmn4j/representation/geometric/PointSet.java | 0.918137 | 0.525856 | PointSet.java | starcoder |
package edu.neu.coe.info6205.graphs.Dijkstra;
/**
* The {@code DirectedEdge} class represents a weighted edge in an
* {@link EdgeWeightedDigraph}. Each edge consists of two integers
* (naming the two vertices) and a real-value weight. The data type
* provides methods for accessing the two endpoints of the dire... | src/main/java/edu/neu/coe/info6205/graphs/Dijkstra/DirectedEdge.java | 0.969382 | 0.831143 | DirectedEdge.java | starcoder |
package java.util;
import jdk.internal.access.JavaLangAccess;
import jdk.internal.access.SharedSecrets;
/**
* {@code StringJoiner} is used to construct a sequence of characters separated
* by a delimiter and optionally starting with a supplied prefix
* and ending with a supplied suffix.
* <p>
* Prior to adding s... | classlib/java.base/src/main/resources/META-INF/modules/java.base/classes/java/util/StringJoiner.java | 0.947533 | 0.579043 | StringJoiner.java | starcoder |
package com.gpudb.protocol;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import org.apache.avro.Schema;
import org.apache.avro.SchemaBuilder;
import org.apache.avro.generic.GenericData;
import org.apache.avro.generic.IndexedRecord;
/**
* A set of parameter... | api/src/main/java/com/gpudb/protocol/VisualizeIsochroneRequest.java | 0.729231 | 0.401394 | VisualizeIsochroneRequest.java | starcoder |
package JuyangBai.Java;
/*
Output the date in multiple formats:
MM/DD/YYYY
June 14, 1992
DDD YYYY
Overloaded constructors
1. input: three integer values
output: MM/DD/YYYY
2. input: a string and two integers
output: June 14, 1992
3. input: two integer values
first: the day number ... | CHAPTER 8/Exercises/8.14 Date Class/Date.java | 0.502686 | 0.473292 | Date.java | starcoder |
package com.upax.exoplayer2.upstream;
import android.net.Uri;
import androidx.annotation.Nullable;
import com.upax.exoplayer2.C;
import java.io.IOException;
import java.util.Collections;
import java.util.List;
import java.util.Map;
/** Reads data from URI-identified resources. */
public interface DataSource extends D... | library/datasource/src/main/java/com/upax/exoplayer2/upstream/DataSource.java | 0.893913 | 0.403626 | DataSource.java | starcoder |
package react;
import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;
import java.util.Objects;
/**
* Provides utility methods for {@link Value}s.
*/
public class Values
{
/** Used by {@link #join(ValueView,ValueView)}. */
public static class T2<A,B> {
public final A a;
... | src/main/java/react/Values.java | 0.944241 | 0.506225 | Values.java | starcoder |
package com.google.common.collect;
import static com.google.common.base.Preconditions.checkArgument;
import com.google.common.annotations.GwtCompatible;
import java.util.EnumMap;
import java.util.Map;
/**
* A {@code BiMap} backed by two {@code EnumMap} instances. Null keys and values
* are not permitted. An {@cod... | analyzed_libs/guava-libraries-read-only/gwt-super/com/google/common/collect/super/com/google/common/collect/EnumBiMap.java | 0.93779 | 0.404625 | EnumBiMap.java | starcoder |
package org.eclipse.jetty.util.statistic;
import java.util.ArrayDeque;
import java.util.Deque;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
/**
* <p>Statistics on a time sequence rate.</p>
* <p>Calculates the rate at which the {@link #record()} method is called
* over the configured p... | jetty-util/src/main/java/org/eclipse/jetty/util/statistic/RateStatistic.java | 0.941385 | 0.470007 | RateStatistic.java | starcoder |
package org.apache.ibatis.session;
import java.io.Closeable;
import java.sql.Connection;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.executor.BatchResult;
/**
* The primary Java interface for working with MyBatis.
* Through this interface you can execute commands, get mappers and manage t... | src/main/java/org/apache/ibatis/session/SqlSession.java | 0.653127 | 0.489198 | SqlSession.java | starcoder |
package projectS.GdxLibrary;
import java.nio.Buffer;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.CharBuffer;
import java.nio.DoubleBuffer;
import java.nio.FloatBuffer;
import java.nio.IntBuffer;
import java.nio.LongBuffer;
import java.nio.ShortBuffer;
import java.util.Arrays;
/** Class with... | ProjectS/src/projectS/GdxLibrary/BufferUtils.java | 0.894011 | 0.661058 | BufferUtils.java | starcoder |
package abi23_0_0.host.exp.exponent.modules.api.components.gesturehandler;
import android.view.MotionEvent;
public class RotationGestureDetector {
public interface OnRotationGestureListener {
boolean onRotation(RotationGestureDetector detector);
boolean onRotationBegin(RotationGestureDetector detector);
... | android/expoview/src/main/java/abi23_0_0/host/exp/exponent/modules/api/components/gesturehandler/RotationGestureDetector.java | 0.833053 | 0.504883 | RotationGestureDetector.java | starcoder |
package us.ihmc.scs2.simulation.robot;
import java.util.List;
import us.ihmc.euclid.referenceFrame.ReferenceFrame;
import us.ihmc.mecano.multiBodySystem.interfaces.JointMatrixIndexProvider;
import us.ihmc.scs2.definition.robot.RobotDefinition;
import us.ihmc.scs2.simulation.robot.controller.RobotControllerManager;
im... | scs2-simulation/src/main/java/us/ihmc/scs2/simulation/robot/RobotExtension.java | 0.895306 | 0.402921 | RobotExtension.java | starcoder |
package io.github.opencubicchunks.cubicchunks.api.util;
import mcp.MethodsReturnNonnullByDefault;
import java.util.Arrays;
import java.util.Iterator;
import javax.annotation.Nullable;
import javax.annotation.ParametersAreNonnullByDefault;
/**
* Hash table implementation for objects in a 2-dimensional cartesian coo... | CubicChunksAPI/src/main/java/io/github/opencubicchunks/cubicchunks/api/util/XZMap.java | 0.895346 | 0.457318 | XZMap.java | starcoder |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.