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.wildbeeslabs.jentle.collections.tree.impl;
import com.wildbeeslabs.jentle.collections.tree.iface.tree.BSTInterface;
import com.wildbeeslabs.jentle.collections.tree.node.TreeNode;
import java.util.ArrayList;
import java.util.List;
/**
* Binary Search Tree Implementation
*/
public class BSTree<T extends ... | collections/src/main/java/com/wildbeeslabs/jentle/collections/tree/impl/BSTree.java | 0.916171 | 0.441553 | BSTree.java | starcoder |
package com.bluegosling.tuples;
import com.bluegosling.function.TriFunction;
import com.bluegosling.function.TriPredicate;
import com.bluegosling.util.ValueType;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.u... | src/com/bluegosling/tuples/Triple.java | 0.937211 | 0.453564 | Triple.java | starcoder |
package com.couchbase.client.java.query.dsl.functions;
import static com.couchbase.client.java.query.dsl.Expression.sub;
import static com.couchbase.client.java.query.dsl.Expression.x;
import com.couchbase.client.core.annotations.InterfaceAudience;
import com.couchbase.client.core.annotations.InterfaceStability;
impo... | src/main/java/com/couchbase/client/java/query/dsl/functions/StringFunctions.java | 0.910127 | 0.616618 | StringFunctions.java | starcoder |
package de.parsemis.utils;
/**
* This class represents a lower (or upper) triangle matrix that stores ints.
*
* @author <NAME> (<EMAIL>)
* @author <NAME> (<EMAIL>)
*
*/
public class HalfIntMatrix implements IntMatrix {
/** the array holding the complete triangle matrix */
private final int[] matrix;
privat... | lib/parsemis/src/de/parsemis/utils/HalfIntMatrix.java | 0.903704 | 0.569075 | HalfIntMatrix.java | starcoder |
package com.github.PeterHausenAoi.evo.flow;
import javafx.scene.canvas.GraphicsContext;
import com.github.PeterHausenAoi.evo.entities.BaseEntity;
import com.github.PeterHausenAoi.evo.entities.Point;
import com.github.PeterHausenAoi.evo.graphics.Drawable;
import java.awt.geom.Line2D;
import java.util.ArrayList;
import... | src/main/java/com/github/PeterHausenAoi/evo/flow/Grid.java | 0.742608 | 0.49646 | Grid.java | starcoder |
package nlp.lowbow.eigenLowbow;
import algebra.Matrix;
import algebra.Vector;
import nlp.segmentedBow.BaseSegmentedBow;
import nlp.segmentedBow.sub.SegmentedBowFactory;
import utils.Interval;
import java.util.ArrayList;
import java.util.List;
public final class MaxDerivativeSegmentator<L extends EigenLowBow, B exten... | src/main/java/nlp/lowbow/eigenLowbow/MaxDerivativeSegmentator.java | 0.854748 | 0.482185 | MaxDerivativeSegmentator.java | starcoder |
package games.office.assassins;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import games.office.assassins.model.Player;
/**
* Examines the scores of all players relative to one another to determine ranks. Rankings are determined by the following
* algorithm:
* - Players wit... | src/main/java/games/office/assassins/PlayerRank.java | 0.72952 | 0.495484 | PlayerRank.java | starcoder |
public class CharMatrix {
private char[][] matrix;
private static final char SPACE = ' ';
/**
* Constructor: creates a grid with dimensions rows, cols,
* and fills it with spaces
*/
public CharMatrix(int rows, int cols) {
this(rows, cols, SPACE);
}
/**
* Constructor: creates a... | winter/homework/labs/Chomp/src/CharMatrix.java | 0.908585 | 0.483222 | CharMatrix.java | starcoder |
package org.apache.flink.table.catalog;
import org.apache.flink.annotation.PublicEvolving;
import org.apache.flink.api.common.typeutils.TypeSerializer;
import org.apache.flink.table.annotation.DataTypeHint;
import org.apache.flink.table.api.DataTypes;
import org.apache.flink.table.api.ValidationException;
import org.a... | flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/DataTypeFactory.java | 0.820254 | 0.49109 | DataTypeFactory.java | starcoder |
package com.googlecode.totallylazy.predicates;
import com.googlecode.totallylazy.*;
import com.googlecode.totallylazy.functions.Callables;
import com.googlecode.totallylazy.functions.Function1;
import java.util.Collection;
import static com.googlecode.totallylazy.functions.Functions.function;
import static com.googl... | ir/src/com/googlecode/totallylazy/predicates/Predicates.java | 0.653127 | 0.491212 | Predicates.java | starcoder |
import javax.imageio.*;
import java.awt.*;
import java.awt.geom.*;
import java.awt.image.*;
import java.io.*;
public final class Blah {
private static int recur(BufferedImage image, Point2D.Double p, double width, double height, double[] t, double blur, double dimness, int depth)
{
Point2D.Double q =... | RecursiveFacebook/Blah.java | 0.809201 | 0.416441 | Blah.java | starcoder |
package stack;
import java.util.Stack;
public class Q678ValidParenthesisString {
//Difficulty: medium
//TAG: Facebook
//TAG: stack
/**
* 678. Valid Parenthesis String
* Given a string containing only three types of characters: '(', ')' and '*', write a function to check whether this string... | src/stack/Q678ValidParenthesisString.java | 0.808067 | 0.462898 | Q678ValidParenthesisString.java | starcoder |
package de.mfo.jsurf.algebra;
import java.util.*;
public class UnivariatePolynomialExpansion extends AbstractVisitor< UnivariatePolynomial, Void >
{
private UnivariatePolynomial x;
private UnivariatePolynomial y;
private UnivariatePolynomial z;
private ValueCalculator valueCalculator;
public ... | src/main/java/de/mfo/jsurf/algebra/UnivariatePolynomialExpansion.java | 0.882851 | 0.703702 | UnivariatePolynomialExpansion.java | starcoder |
package com.twu.biblioteca;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class BibliotecaApp {
static book book1 = new book("book1", "A", 2021);
static book book2 = new book("book2", "B", 2022);
static book book3 = new book("book3", "C", 2023);
static List<book... | TWU_Biblioteca-master/src/com/twu/biblioteca/BibliotecaApp.java | 0.644001 | 0.579728 | BibliotecaApp.java | starcoder |
package androidx.heifwriter;
import android.graphics.Rect;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.FloatBuffer;
/**
* This class represents a viewport-sized sprite that will be rendered with
* a subrect from a texture.
*
* @hide
*/
public class EglRectBlt {
private static fina... | heifwriter/src/main/java/androidx/heifwriter/EglRectBlt.java | 0.919122 | 0.417034 | EglRectBlt.java | starcoder |
package io.github.phantamanta44.mcrail.railtech.common.item;
import io.github.phantamanta44.mcrail.railflux.item.ItemLoreEnergy;
import io.github.phantamanta44.mcrail.railflux.item.LoreEnergyStackWrapper;
import org.bukkit.inventory.ItemStack;
public abstract class ItemEnergizedRated extends ItemLoreEnergy {
pri... | src/main/java/io/github/phantamanta44/mcrail/railtech/common/item/ItemEnergizedRated.java | 0.876317 | 0.532304 | ItemEnergizedRated.java | starcoder |
package jcifs.internal.util;
import jcifs.SmbConstants;
/**
* @author mbechler
*
*/
@SuppressWarnings ( "javadoc" )
public class SMBUtil {
public static void writeInt2 ( long val, byte[] dst, int dstIndex ) {
dst[ dstIndex ] = (byte) ( val );
dst[ ++dstIndex ] = (byte) ( val >> 8 );
}
... | external/jcifs-ng/src/main/java/jcifs/internal/util/SMBUtil.java | 0.522933 | 0.488954 | SMBUtil.java | starcoder |
package net.lucenews.opensearch;
import static org.junit.Assert.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
public class OpenSearchQueryTest {
@Before
public void setUp() throws Exception {
}
@After
public void tearDown() throws Exception {
}
@Test
/*... | test/net/lucenews/opensearch/OpenSearchQueryTest.java | 0.866627 | 0.522324 | OpenSearchQueryTest.java | starcoder |
package io.github.primepotato.jandas.io.parsers;
import com.google.common.collect.ImmutableList;
import java.util.Arrays;
import java.util.stream.Collectors;
public abstract class AbstractParser<T> {
public static final ImmutableList<String> MISSING_INDICATORS = ImmutableList.of(
"null", "NULL", "N... | src/main/java/io/github/primepotato/jandas/io/parsers/AbstractParser.java | 0.833934 | 0.415373 | AbstractParser.java | starcoder |
package io.improbable.keanu.tensor.dbl;
import io.improbable.keanu.tensor.INDArrayExtensions;
import io.improbable.keanu.tensor.INDArrayShim;
import io.improbable.keanu.tensor.Tensor;
import io.improbable.keanu.tensor.TensorShape;
import io.improbable.keanu.tensor.TensorShapeValidation;
import io.improbable.keanu.tens... | keanu-project/src/main/java/io/improbable/keanu/tensor/dbl/Nd4jDoubleTensor.java | 0.85564 | 0.576602 | Nd4jDoubleTensor.java | starcoder |
package jsl.utilities.random.rvariable;
import jsl.utilities.random.rng.RNStreamIfc;
/** Allows for the generation of bivariate normal
* random variables
*
* @author rossetti
*/
public class BivariateLogNormalRV extends AbstractMVRVariable{
private final BivariateNormalRV myBVN;
private final double m... | JSLCore/src/main/java/jsl/utilities/random/rvariable/BivariateLogNormalRV.java | 0.936554 | 0.651784 | BivariateLogNormalRV.java | starcoder |
package episim.util;
import java.util.ArrayList;
import java.util.List;
/**
* Résout un système différentiel avec la méthode d'Euler explicite
*/
public abstract class EulerSolver {
public interface DerivativeFunc {
List<Double> compute(double t, List<Double> y);
}
public interface ValueLimit {
... | app/src/main/java/episim/util/EulerSolver.java | 0.754644 | 0.651112 | EulerSolver.java | starcoder |
package org.odk.collect.android.database.BaseDatosEngine.Entidades;
public class EstadoFormularioSession {
public static String e_idAccount="e_idAccount" ;
public static String e_IdCampania="e_IdCampania" ;
public static String e_code="e_code" ;
public static String e_ruta="e_ruta" ;
public static ... | collect_app/src/main/java/org/odk/collect/android/database/BaseDatosEngine/Entidades/EstadoFormularioSession.java | 0.59972 | 0.41561 | EstadoFormularioSession.java | starcoder |
package asteris.app.table;
import java.awt.Color;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.swing.table.AbstractTableModel;
public class AdvancedTableModel extends AbstractTableModel {
private final List<Column> columns = new ArrayList<>();
List<Color> rowColou... | src/asteris/app/table/AdvancedTableModel.java | 0.945513 | 0.474144 | AdvancedTableModel.java | starcoder |
package javax.time;
import static javax.time.calendrical.ChronoField.OFFSET_SECONDS;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertSame;
import static org.testng.Assert.assertTrue;
import static org.testng.Assert.fail;
import java.io.ByteArrayInputStream;
import java.io.ByteArray... | src/tck/java/javax/time/TCKZoneOffset.java | 0.772874 | 0.416203 | TCKZoneOffset.java | starcoder |
package tiktaktoe.kleinefynn.com.github;
import java.util.function.Function;
public class TikTakToe
{
private final static int DEFAULT_GAME_SIZE = 2;
private TikTakToeField field;
private ITikTakToeDisplay display;
private TikTakToePlayer[] players;
//Creates field with default size and 2 player... | src/tiktaktoe/kleinefynn/com/github/TikTakToe.java | 0.709925 | 0.572364 | TikTakToe.java | starcoder |
public class ConwayGameOfLifeDemo {
boolean[][] board; // the state of the board to display (the output of the simulation step)
boolean[][] previous; // the previous state of the board (used in the simulation step)
private double tileW; // the width of each board tile in screen pixels (used in display and mouse inte... | TopSecret/ConwayGameOfLifeDemo.java | 0.720663 | 0.739986 | ConwayGameOfLifeDemo.java | starcoder |
package com.joseduarte.dwssurviveallyoucan.physics;
import android.graphics.Point;
import android.graphics.Rect;
import com.joseduarte.dwssurviveallyoucan.entities.Entity;
public class CollisionBox {
public static final int LEFT_X = 0;
public static final int RIGHT_X = 1;
public static final int TOP_Y =... | app/src/main/java/com/joseduarte/dwssurviveallyoucan/physics/CollisionBox.java | 0.861159 | 0.540257 | CollisionBox.java | starcoder |
import epic.sequences.SemiCRF;
import java.io.*;
import java.util.*;
public class SelectQuery {
/**
* SelectQuery finds the next batch for labeling. It goes through a file and finds the value of the current sentence
* according to the current model
* @param fileName The name of the file from which... | src/main/java/SelectQuery.java | 0.61173 | 0.408395 | SelectQuery.java | starcoder |
package umontreal.iro.lecuyer.contactcenters.router;
import umontreal.iro.lecuyer.contactcenters.contact.Contact;
import umontreal.iro.lecuyer.contactcenters.queue.DequeueEvent;
import umontreal.iro.lecuyer.contactcenters.queue.WaitingQueue;
import umontreal.iro.lecuyer.contactcenters.server.Agent;
import umontreal.ir... | source/umontreal/iro/lecuyer/contactcenters/router/AgentsPrefRouter.java | 0.683631 | 0.666378 | AgentsPrefRouter.java | starcoder |
package com.tunnelvisionlabs.util.concurrent;
import com.tunnelvisionlabs.util.validation.NotNull;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionException;
import java.util.concurrent.TimeUnit;
import org.junit.Assert;
import org.junit.Test;
import static org.hamcrest.CoreMatche... | test/com/tunnelvisionlabs/util/concurrent/AsyncCountdownEventTest.java | 0.830285 | 0.476884 | AsyncCountdownEventTest.java | starcoder |
package CarSalesman;
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = Integer.parseInt(scanner.nextLine());
Map<String, Engine> engines = new HashMap<>();
Engine engine;
for (int i = 0; i < n... | Java Advanced/Defining Classes/src/CarSalesman/Main.java | 0.704973 | 0.404978 | Main.java | starcoder |
package com.raylabz.firestorm;
import com.google.api.core.ApiFuture;
import com.google.api.gax.rpc.ApiStreamObserver;
import com.google.cloud.firestore.*;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutionExceptio... | src/main/java/com/raylabz/firestorm/FirestormFilterable.java | 0.946892 | 0.460835 | FirestormFilterable.java | starcoder |
package kcl.teamIndexZero.traffic.simulator.data.mapObjects;
import kcl.teamIndexZero.traffic.log.Logger;
import kcl.teamIndexZero.traffic.log.Logger_Interface;
import kcl.teamIndexZero.traffic.simulator.ISimulationAware;
import kcl.teamIndexZero.traffic.simulator.data.ID;
import kcl.teamIndexZero.traffic.simulator.da... | simulator/src/main/java/kcl/teamIndexZero/traffic/simulator/data/mapObjects/MapObject.java | 0.859177 | 0.401072 | MapObject.java | starcoder |
package dk.statsbiblioteket.summa.common.shell;
import java.io.IOException;
import java.util.*;
/**
* A helper class to print tabular data to an {@code Appendable}
*/
public class Layout {
private List<String> columns;
private boolean printHeaders;
private Model model;
private String delimiter;
... | Core/src/main/java/dk/statsbiblioteket/summa/common/shell/Layout.java | 0.859516 | 0.541954 | Layout.java | starcoder |
package io.opensphere.core.projection;
import java.util.Collection;
import org.apache.log4j.Logger;
import io.opensphere.core.math.Vector3d;
import io.opensphere.core.model.GeographicBoundingBox;
import io.opensphere.core.model.GeographicConvexPolygon;
import io.opensphere.core.model.GeographicPosition;
import io.op... | open-sphere-base/core/src/main/java/io/opensphere/core/projection/GeographicProjectionModel.java | 0.94062 | 0.491761 | GeographicProjectionModel.java | starcoder |
package gov.sandia.cognition.learning.algorithm.minimization;
import gov.sandia.cognition.annotation.PublicationReference;
import gov.sandia.cognition.annotation.PublicationReferences;
import gov.sandia.cognition.annotation.PublicationType;
import gov.sandia.cognition.learning.algorithm.minimization.line.DirectionalVe... | Components/LearningCore/Source/gov/sandia/cognition/learning/algorithm/minimization/FunctionMinimizerQuasiNewton.java | 0.955744 | 0.566468 | FunctionMinimizerQuasiNewton.java | starcoder |
package com.freetymekiyan.algorithms.level.easy;
/**
* 674. Longest Continuous Increasing Subsequence
* <p>
* Given an unsorted array of integers, find the length of longest continuous increasing subsequence (subarray).
* <p>
* Example 1:
* Input: [1,3,5,4,7]
* Output: 3
* Explanation: The longest continuous i... | src/main/java/com/freetymekiyan/algorithms/level/easy/LongestContinuousIncreasingSubsequence.java | 0.91138 | 0.528229 | LongestContinuousIncreasingSubsequence.java | starcoder |
package org.qore.KPC;
import java.util.*;
/**
* Simple helper math functions.
*/
public class Equations {
/**
* Cumulative sum of an array, where the value at each index of the result is the
* sum of all the previous values of the input.
* @param ar Array we want the cumulative sum of.
* @r... | src/main/java/org/qore/KPC/Equations.java | 0.805556 | 0.721351 | Equations.java | starcoder |
package org.opensha.refFaultParamDb.vo;
/**
* <p>Title: CombinedSlipRateInfo.java </p>
* <p>Description: This class saves all the information if the user wants
* to contribute slip rate info for a site.</p>
* <p>Copyright: Copyright (c) 2002</p>
* <p>Company: </p>
* @author not attributable
* @version 1.0
*/
... | src/main/java/org/opensha/refFaultParamDb/vo/CombinedSlipRateInfo.java | 0.595493 | 0.400867 | CombinedSlipRateInfo.java | starcoder |
package ooga.model.gameBuildingBlocks.boardMoveUpdate;
import static org.junit.jupiter.api.Assertions.*;
import java.util.List;
import ooga.model.BoardStructure;
import ooga.model.PieceBoardStructure;
import ooga.model.pieces.EmptyPiece;
import ooga.model.pieces.NormalPiece;
import ooga.model.pieces.PieceTypeFactory;... | test/ooga/model/gameBuildingBlocks/boardMoveUpdate/UpdateBottomRowTest.java | 0.77806 | 0.445107 | UpdateBottomRowTest.java | starcoder |
package de.emaeuer.environment.balance.twodim.element;
import com.google.common.primitives.Doubles;
import de.emaeuer.environment.AgentController;
import de.emaeuer.environment.balance.twodim.GeneralTwoDimensionalCartPoleData;
import de.emaeuer.environment.balance.twodim.TwoDimensionalCartPoleEnvironment;
import de.em... | particle_environment_engine/src/main/java/de/emaeuer/environment/balance/twodim/element/TwoDimensionalCart.java | 0.730097 | 0.596433 | TwoDimensionalCart.java | starcoder |
Copyright 2017 <NAME>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distri... | src/main/java/org/omnaest/utils/MapUtils.java | 0.954361 | 0.4081 | MapUtils.java | starcoder |
package com.google.clearsilver.jsilver.data;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Logger;
/**
* Implementation of Data that allows for multiple underlying Data objects and checks each one in
* order for a value before giving up. Behaves like local H... | jsilver/src/com/google/clearsilver/jsilver/data/ChainedData.java | 0.890622 | 0.607809 | ChainedData.java | starcoder |
package org.lwjgl.util.vector;
import java.nio.ByteBuffer;
import java.nio.IntBuffer;
public class Vector3i implements Readable, Writable{
public int x,y,z;
public Vector3i() {
}
public Vector3i(int x, int y, int z) {
this.x = x;
this.y = y;
this.z = z;
}
public Vector3i(Vector3i v) {
set(v);
}
... | gl_math/src/main/java/org/lwjgl/util/vector/Vector3i.java | 0.755005 | 0.568655 | Vector3i.java | starcoder |
package com.kapoorlabs.kiara.util;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.time.format.DateTimeFormatter;
import com.kapoorlabs.kiara.constants.Delimiters;
import com.kapoorlabs.kiara.constants.SdqlConstants;
import com.kapoorlabs.kiara.domain.SecondaryColl... | src/main/java/com/kapoorlabs/kiara/util/NumericUtil.java | 0.840324 | 0.431405 | NumericUtil.java | starcoder |
package org.apache.wayang.core.optimizer.costs;
import org.apache.wayang.core.optimizer.ProbabilisticIntervalEstimate;
import org.apache.wayang.core.util.Formats;
/**
* An estimate of time (in <b>milliseconds</b>) expressed as a {@link ProbabilisticIntervalEstimate}.
*/
public class TimeEstimate extends Probabilist... | wayang-commons/wayang-core/src/main/java/org/apache/wayang/core/optimizer/costs/TimeEstimate.java | 0.958314 | 0.496521 | TimeEstimate.java | starcoder |
package edu.uiuc.zenvisage.service.utility;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import edu.uiuc.zenvisage.model.ZvQuery;
/**
*
*/
public class DataReformation {
public Normalization normali... | src/main/java/edu/uiuc/zenvisage/service/utility/DataReformation.java | 0.623148 | 0.412708 | DataReformation.java | starcoder |
* This file is available under and governed by the GNU General Public
* License version 2 only, as published by the Free Software Foundation.
* However, the following notice accompanied the original version of this
* file:
*
* Written by <NAME> with assistance from members of JCP JSR-166
* Expert Group and relea... | test/jdk/java/util/concurrent/tck/TimeUnitTest.java | 0.865437 | 0.544075 | TimeUnitTest.java | starcoder |
package net.gegy1000.terrarium.server.world.layer;
import net.minecraft.world.gen.layer.GenLayer;
import net.minecraft.world.gen.layer.IntCache;
public class OutlineEdgeLayer extends GenLayer {
private final int outline;
public OutlineEdgeLayer(int outline, long seed, GenLayer parent) {
super(seed);
... | src/main/java/net/gegy1000/terrarium/server/world/layer/OutlineEdgeLayer.java | 0.806243 | 0.424651 | OutlineEdgeLayer.java | starcoder |
package day5p1;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
public class Flight {
private String flightNumber;
private String airliner;
private String source;
private LocalDateTime flyDat... | TASK 4 JAVA Basics/Flight.java | 0.67822 | 0.407039 | Flight.java | starcoder |
package de.perdian.games.minesweeper.core;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CopyOnWriteArrayList;
/**
* The board in which the cells are located
*
* @author <NA... | src/main/java/de/perdian/games/minesweeper/core/MinesweeperBoard.java | 0.80969 | 0.477737 | MinesweeperBoard.java | starcoder |
package org.epi.model.world;
import org.epi.model.human.Human;
import org.epi.model.human.Model;
import org.epi.util.Error;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
/**
* A utility class for spatial hashing of populations.
*/
public c... | src/main/java/org/epi/model/world/SpatialHash.java | 0.922067 | 0.486392 | SpatialHash.java | starcoder |
package vector2d;
/**
* The purpose of this class is to create a 2D vector and to modify it and get
* different variables from it and do addition, subtraction, dot product on it and<br>
* to calculate the vector norm and to create a unit vector from any vector. also
* modifies toString.
* CSC 1350 Project #4 <br... | java I/jardo16_proj04/Vector2D.java | 0.921706 | 0.797241 | Vector2D.java | starcoder |
package ca.craigthomas.yacoco3e.common;
/**
* A Field is used to store information of variable size. Fields
* typically have two sections:
*
* - a gap at the beginning with a specific size
* - a data section with a specific size
*
* The Field class is typically used within a DiskSector. Class
* methods exist t... | src/main/java/ca/craigthomas/yacoco3e/common/Field.java | 0.929696 | 0.745815 | Field.java | starcoder |
import ru.innopolis.comicon.stdlib.Boolean;
import Integer;
import ru.innopolis.comicon.stdlib.Real;
import static org.junit.Assert.assertEquals;
class BooleanTest {
@org.junit.jupiter.api.Test
void createBoolean() {
Boolean test = new Boolean();
Boolean test2 = new Boolean();
asser... | Test/BooleanTest.java | 0.630571 | 0.571408 | BooleanTest.java | starcoder |
package takty.color;
/**
* This class converts the CIELAB (L*a*b*) color system.
* By default, D65 is used as tristimulus value.
* Reference: http://en.wikipedia.org/wiki/Lab_color_space
* @author <NAME>
* @version 2018-04-19
*/
public class Lab extends ColorSpace {
// Constants for simplification of calculati... | src/takty/color/Lab.java | 0.806434 | 0.415492 | Lab.java | starcoder |
package gov.sandia.cognition.evaluator;
import gov.sandia.cognition.util.AbstractCloneableSerializable;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Unit tests for class {@link ForwardReverseEvaluatorPair}.
*
* @author <NAME>
* @since 3.3.3
*/
public class ForwardReverseEvaluatorPairTest
... | Components/CommonCore/Test/gov/sandia/cognition/evaluator/ForwardReverseEvaluatorPairTest.java | 0.940442 | 0.46642 | ForwardReverseEvaluatorPairTest.java | starcoder |
package com.opengamma.engine.function;
import java.util.Map;
import java.util.Set;
import javax.time.Instant;
import javax.time.InstantProvider;
import com.google.common.collect.Sets;
import com.opengamma.engine.ComputationTarget;
import com.opengamma.engine.ComputationTargetType;
import com.opengamma.engine.value.C... | projects/OG-Engine/src/main/java/com/opengamma/engine/function/NoOpFunction.java | 0.905795 | 0.454109 | NoOpFunction.java | starcoder |
package org.ehrbase.aql.util;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import org.ehrbase.aql.binder.AqlBinder;
import org.ehrbase.aql.dto.AqlDto;
import org.ehrbase.aql.dto.condition.*;
import org.ehrbase.aql.parser.AqlToDtoParser;
public class AqlUtil {
private AqlUtil() {}
... | aql/src/main/java/org/ehrbase/aql/util/AqlUtil.java | 0.855187 | 0.484807 | AqlUtil.java | starcoder |
package me.lucko.helper.serialize;
import com.google.common.base.Preconditions;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import me.lucko.helper.gson.GsonSerializable;
import me.lucko.helper.gson.JsonBuilder;
import me.lucko.helper.utils.Maths;
import org.bukkit.block.Block;
import javax.... | helper/src/main/java/me/lucko/helper/serialize/CircularRegion.java | 0.911407 | 0.416263 | CircularRegion.java | starcoder |
package camzup.core;
import java.util.Comparator;
import java.util.Random;
/**
* A two-dimensional complex number. The <code>imag</code> component is a
* coefficient of <em>i</em>, or the square-root of negative one.
*/
public class Complex implements Comparable < Complex > {
/**
* The coefficient of the i... | src/camzup/core/Complex.java | 0.972415 | 0.581481 | Complex.java | starcoder |
package pa3;
public class Neuron {
double[] weights;
Neuron[] values;
double value;
double target;
double delta;
double sigmoid;
double weightedSum;
double sigmoidDerivative;
int index;
public String label;
private String type;
// Input Neuron
public Neuron(double value) {
this.type = "input"... | backpropagation/src/pa3/Neuron.java | 0.706494 | 0.562717 | Neuron.java | starcoder |
package com.nwawsoft.util.datastructures;
import com.nwawsoft.util.tools.DebugPrinter;
/**
* Tree data structure which can contain up to 2 additional {@code Tree}s.
* Every {@code BinaryTree} can be a root itself, can contain one or no {@code content} object and none, one or two
* additional {@code Tree} objects.
... | src/main/java/com/nwawsoft/util/datastructures/BinaryTree.java | 0.957118 | 0.698574 | BinaryTree.java | starcoder |
package org.cometd.bayeux.server;
/**
* <p>A Bayeux {@link SecurityPolicy} defines the broad authorization constraints that must be enforced by
* a {@link BayeuxServer}.
* </p>
* The usage of SecurityPolicy has been mostly replaced by the more flexible {@link Authorizer}.
* ,p>
* <p>A {@link BayeuxServer} may de... | cometd-java/bayeux-api/src/main/java/org/cometd/bayeux/server/SecurityPolicy.java | 0.931688 | 0.449574 | SecurityPolicy.java | starcoder |
package org.lab41.dendrite.metagraph;
import com.thinkaurelius.titan.core.*;
import com.tinkerpop.blueprints.*;
import com.tinkerpop.blueprints.Parameter;
import org.lab41.dendrite.metagraph.DendriteGraph;
import org.lab41.dendrite.metagraph.DendriteGraphTransactionBuilder;
import org.lab41.dendrite.metagraph.Dendrite... | src/main/java/org/lab41/dendrite/metagraph/DendriteGraphBatchWrapper.java | 0.831793 | 0.433622 | DendriteGraphBatchWrapper.java | starcoder |
package org.graalvm.compiler.lir.alloc.lsra;
/**
* Represents a range of integers from a start (inclusive) to an end (exclusive.
*/
public final class Range {
/**
* The start of the range, inclusive.
*/
public int from;
/**
* The end of the range, exclusive.
*/
public int to;
... | src/jdk14-source/jdk.internal.vm.compiler/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/Range.java | 0.906253 | 0.406479 | Range.java | starcoder |
package ro.deiutzblaxo.ProprietyPlugin.Utilis;
/**
* Represents a 3d vector.
*/
public class Vector3 implements Comparable<Vector3> {
/**
* Vector with all elements set to 0. (0, 0, 0)
*/
public final static Vector3 ZERO = new Vector3(0, 0, 0);
/**
* Unit Vector in the X direction. (1, 0, 0)
*/
public f... | src/main/java/ro/deiutzblaxo/ProprietyPlugin/Utilis/Vector3.java | 0.910883 | 0.740479 | Vector3.java | starcoder |
package manifold;
import java.util.ArrayList;
import java.util.List;
import math.VecMath;
import objects.SupportMap;
import quaternion.Quaternionf;
import vector.Vector3f;
public class MultiPointManifoldManager extends ManifoldManager<Vector3f, Quaternionf> {
final List<CollisionManifold<Vector3f, Quaternionf>> col... | JAwesomePhysics/src/manifold/MultiPointManifoldManager.java | 0.793666 | 0.576155 | MultiPointManifoldManager.java | starcoder |
package com.github.nsc.de.compiler.lexer.characterinputstream;
import com.github.nsc.de.compiler.lexer.Position;
/**
* A {@link CharacterInputStream} provides the characters for the {@link com.github.nsc.de.compiler.lexer.Lexer}
*
* @author <a href="https://github.com/nsc-de"><NAME> <@nsc-de></a>
*
* @see ... | src/main/java/com/github/nsc/de/compiler/lexer/characterinputstream/CharacterInputStream.java | 0.936256 | 0.456591 | CharacterInputStream.java | starcoder |
package org.github.com.jvec.vclock;
import java.util.Map;
import java.util.TreeMap;
/**
* This is the vector clock class, which contains a map of id and time.
* "id" is a string representing the id of the particular clock entry.
* "time" is a 64 bit integer denoting the current time value of a clock.
*/
public c... | jvec/org/github/com/jvec/vclock/VClock.java | 0.926562 | 0.498657 | VClock.java | starcoder |
package com.verictas.pos.simulator;
import javax.vecmath.*;
import java.lang.*;
public class Object {
public double mass;
public Vector3d position;
public Vector3d speed;
public Vector3d acceleration;
public Vector3d oldAcceleration;
public String name;
private double gravitationalConsta... | simulator/src/com/verictas/pos/simulator/Object.java | 0.948274 | 0.738622 | Object.java | starcoder |
package com.github.nagyesta.yippeekijson.core;
import com.github.nagyesta.yippeekijson.metadata.schema.entity.typehelper.ParametrizedTypeAware;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.reflect.TypeUtils;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nulla... | src/main/java/com/github/nagyesta/yippeekijson/core/NamedComponentUtil.java | 0.949365 | 0.411879 | NamedComponentUtil.java | starcoder |
public class Vector3d {
double x;
double y;
double z;
public Vector3d(double x, double y, double z) {
// Constructor
this.x = x;
this.y = y;
this.z = z;
}
public Vector3d(double[] coords) {
// Constructor
this.x = coords[0];
this.y = coords[1];
this.z = coords[2];
}
public double[] getCoor... | src/Vector3d.java | 0.85449 | 0.873701 | Vector3d.java | starcoder |
package org.apache.commons.geometry.io.euclidean.threed;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import org.apache.commons.geometry.euclidean.threed.Vector3D;
/** Simple {@link FacetDefinition} implementation that stores a list of vertices and
* optional normal.
*/
public cla... | commons-geometry-io-euclidean/src/main/java/org/apache/commons/geometry/io/euclidean/threed/SimpleFacetDefinition.java | 0.948656 | 0.568146 | SimpleFacetDefinition.java | starcoder |
class LRUCache {
private Map<Integer, ListNode> lruMap;
private ListNode head = null, tail = null;
private int capacity = 0;
public LRUCache(int capacity) {
this.lruMap = new HashMap<>();
this.capacity = capacity;
}
public int get(int key) {
if(!lruMap.containsKey(k... | java/src/leetcode/hard/LRUCache.java | 0.825414 | 0.514034 | LRUCache.java | starcoder |
package com.deblock.jsondiff.diff;
import com.deblock.jsondiff.matcher.Path;
import com.deblock.jsondiff.viewer.JsonDiffViewer;
import com.fasterxml.jackson.databind.JsonNode;
import java.util.HashMap;
import java.util.Map;
public class JsonArrayDiff implements JsonDiff {
private final Map<Integer, JsonNode> val... | src/main/java/com/deblock/jsondiff/diff/JsonArrayDiff.java | 0.904674 | 0.418578 | JsonArrayDiff.java | starcoder |
package maspack.render.GL.GL3;
import java.nio.ByteBuffer;
import com.jogamp.opengl.GL;
import com.jogamp.opengl.GL3;
import maspack.render.GL.GL3.GL3SharedPrimitive.AxesKey;
import maspack.render.GL.GL3.GL3SharedPrimitive.ConeKey;
import maspack.render.GL.GL3.GL3SharedPrimitive.CubeKey;
import maspack.render.GL.GL3... | src/maspack/render/GL/GL3/GL3PrimitiveFactory.java | 0.588653 | 0.415847 | GL3PrimitiveFactory.java | starcoder |
package kuklinski.model;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class Fullerene {
private final int CARBON_INDEX = 1;
private final int X_POS_INDEX = 2;
private final int Y_POS_INDEX = 3;
private final int Z_POS_INDEX = 4;
private final int NEIGHBOR_1_I... | src/main/java/kuklinski/model/Fullerene.java | 0.668988 | 0.510619 | Fullerene.java | starcoder |
package ExerciciosExtras;
/**
* Encapsulates logic for the quicksort algorithm.
* Encapsula a lógica do algorítimo quicksort
*/
public class QuickSort {
/**
* Sort an array by using the quicksort algorithm. Must not be null.
* Ordena o array usando o algoritmo quicksort. Não deve ser nulo.
* @par... | Java/ExerciciosExtras/QuickSort.java | 0.887424 | 0.610134 | QuickSort.java | starcoder |
package org.apache.wayang.commons.util.profiledb;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import org.apache.wayang.commons.util.profiledb.json.MeasurementDeserializer;
import org.apache.wayang.commons.util.profiledb.json.MeasurementSerializer;
import org.apache.wayang.commons.util.profiledb.mo... | wayang-commons/wayang-utils-profile-db/src/main/java/org/apache/wayang/commons/util/profiledb/ProfileDB.java | 0.934991 | 0.435061 | ProfileDB.java | starcoder |
package com.datadoghq.sketch;
import java.util.NoSuchElementException;
import java.util.function.DoubleConsumer;
/**
* A data structure that consumes {@code double} values and can compute quantiles over the ingested
* values.
*
* <p>Quantile values are usually computed with an approximation error that depends on ... | src/main/java/com/datadoghq/sketch/QuantileSketch.java | 0.948953 | 0.592519 | QuantileSketch.java | starcoder |
package doublyLinkedList.recursive;
import abstractions.BidirectionalLinkedList;
import singlyLinkedList.recursive.SinglyLinkedList;
/**
* A doubly linked list is a linked data structure that consists of a set of
* sequentially linked nodes. Each node contains two links that references the
* previous and the next ... | doublyLinkedList/recursive/DoublyLinkedList.java | 0.865793 | 0.427815 | DoublyLinkedList.java | starcoder |
package pl.wurmonline.deedplanner.data;
import com.jogamp.common.nio.Buffers;
import java.nio.FloatBuffer;
import com.jogamp.opengl.GL2;
import org.w3c.dom.*;
import pl.wurmonline.deedplanner.data.storage.Data;
import pl.wurmonline.deedplanner.graphics.wom.Model;
public class Roof implements TileEntity {
private... | src/main/java/pl/wurmonline/deedplanner/data/Roof.java | 0.692954 | 0.438124 | Roof.java | starcoder |
package us.ihmc.robotics.robotDescription;
import java.util.List;
import javax.vecmath.Vector3d;
import us.ihmc.robotics.Axis;
public class OneDoFJointDescription extends JointDescription
{
private boolean containsLimitStops;
private double qMin = Double.NEGATIVE_INFINITY;
private double qMax = Double.POSI... | IHMCRobotDescription/src/us/ihmc/robotics/robotDescription/OneDoFJointDescription.java | 0.935472 | 0.491883 | OneDoFJointDescription.java | starcoder |
package deepDriver.dl.aml.math;
import org.jblas.DoubleMatrix;
import org.jblas.FloatMatrix;
public class BlasMathFunction implements IMathFunction {
@Override
public int getThreadCnt() {
return 0;
}
@Override
public void setThreadCnt(int threadCnt) {
}
@Override
public double[][] transpose(double[][] x... | src/deepDriver/dl/aml/math/BlasMathFunction.java | 0.639961 | 0.621311 | BlasMathFunction.java | starcoder |
package org.apache.flink.table.planner.delegation.hive.copy;
import org.apache.flink.table.planner.delegation.hive.parse.HiveASTParser;
import org.antlr.runtime.TokenRewriteStream;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hive.ql.metadata.HiveUtils;
import java.util.ArrayList;
import jav... | flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/planner/delegation/hive/copy/HiveParserUnparseTranslator.java | 0.892621 | 0.401805 | HiveParserUnparseTranslator.java | starcoder |
package org.rdfhdt.hdt.util;
public class SortUtils {
/**
* Searches a sorted int array for a specified value, using an optimized
* binary search algorithm (which tries to guess smart pivots). The result
* is unspecified if the array is not sorted. The method returns an index
* where key was found in t... | WiseKG.Server/src/main/java/org/rdfhdt/hdt/util/SortUtils.java | 0.841337 | 0.446615 | SortUtils.java | starcoder |
package codefights.interview.backtracking;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* https://codefights.com/interview-practice/task/7u7oKqXoFdmh3vGyb
* In chess, queens can move any number of squares vertically, horizontally, or diagonally. The n-queens puzzle is the problem ... | nc-java/src/codefights/interview/backtracking/NQueens.java | 0.79162 | 0.598664 | NQueens.java | starcoder |
package com.monsieurmahjong.commonjong.rules.generic.utils;
import org.junit.jupiter.api.*;
import com.monsieurmahjong.commonjong.rules.generic.MahjongTileKind;
public class WaitShapeUtilsTest
{
@Test
public void testIsGroup()
{
Assertions.assertTrue(WaitShapeUtils.isGroup(MahjongTileK... | tests/com/monsieurmahjong/commonjong/rules/generic/utils/WaitShapeUtilsTest.java | 0.767472 | 0.61025 | WaitShapeUtilsTest.java | starcoder |
package com.is2t.mwt.util;
/**
* Utilities for decimal numbers.
*/
public class DecimalNumber {
private DecimalNumber() {
}
/**
* Gets the integer part of the given value.
*
* @param value
* the argument whose integer part is to be determined.
* @return the integer part of the given value.
... | com.is2t.widgets/src/java/com/is2t/mwt/util/DecimalNumber.java | 0.890461 | 0.668123 | DecimalNumber.java | starcoder |
package net.meisen.dissertation.impl.indexes;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import java.util.UUID;
import net.meisen.dissertation.config.TestConfig;
import net.meisen.dissertation.config.xslt.DefaultValues;
import net.meisen.dissertation.help.ModuleBasedTe... | test/net/meisen/dissertation/impl/indexes/TestIndexFactory.java | 0.736685 | 0.406509 | TestIndexFactory.java | starcoder |
package model.environment.objects.physicalObject;
import java.util.List;
import model.agent.humanAgent.HumanAgent;
import model.environment.position.Position;
/**
* A desk is used to serve people.
*
* @author <NAME>
*/
public class Desk extends PhysicalObject implements Openable {
/**
* The serving position... | Simulator/src/model/environment/objects/physicalObject/Desk.java | 0.882098 | 0.603873 | Desk.java | starcoder |
package com.castle.time;
import com.castle.annotations.Immutable;
import com.castle.util.CompareResult;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
@Immutable
public class Time implements Comparable<Time> {
public static final long INVALID_VALUE = -1L;
public static final Time INVALID = ... | castle.core/src/main/java/com/castle/time/Time.java | 0.926287 | 0.553807 | Time.java | starcoder |
package maxhyper.dynamictreesic2.genfeatures;
import com.ferreusveritas.dynamictrees.api.IPostGenFeature;
import com.ferreusveritas.dynamictrees.api.IPostGrowFeature;
import com.ferreusveritas.dynamictrees.api.TreeHelper;
import com.ferreusveritas.dynamictrees.blocks.BlockBranch;
import com.ferreusveritas.dynamictrees... | src/main/java/maxhyper/dynamictreesic2/genfeatures/FeatureGenSapLog.java | 0.760384 | 0.435481 | FeatureGenSapLog.java | starcoder |
package de.hfu.in.machinelearning.crawling_robot_2d_sim.models;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.geom.AffineTransform;
import java.awt.geom.Arc2D;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Line2D;
import java.awt.geom.Path2D;
import org.dyn4j.geometry.Capsule;
import org.d... | src/main/java/de/hfu/in/machinelearning/crawling_robot_2d_sim/models/ShapeRenderer.java | 0.909325 | 0.598224 | ShapeRenderer.java | starcoder |
package cl.uchile.dcc.scrabble.type;
import java.math.BigInteger;
import java.util.Objects;
/**
* Implementation of a Scrabble binary as a class. A binary is a number type and a logical type since it can operate
* as a number and a boolean.
*
* <p>There are two types of binaries:</p>
* <ul>
* <li>An "int" b... | src/main/java/cl/uchile/dcc/scrabble/type/ScrabbleBinary.java | 0.964648 | 0.635958 | ScrabbleBinary.java | starcoder |
package com.ale.o2g;
import java.util.Collection;
import com.ale.o2g.internal.services.IService;
import com.ale.o2g.types.comlog.ComRecord;
import com.ale.o2g.types.comlog.Page;
import com.ale.o2g.types.comlog.QueryFilter;
import com.ale.o2g.types.comlog.QueryResult;
/**
* The {@code CommunicationLogService} servi... | src/main/java/com/ale/o2g/CommunicationLogService.java | 0.926229 | 0.44746 | CommunicationLogService.java | starcoder |
package com.rh12503.rendering.g2d;
import com.rh12503.rendering.DrawingCanvas;
import com.rh12503.rendering.SimpleColor;
import com.rh12503.rendering.pixelbuffer.PixelBuffer;
import com.rh12503.rendering.pixelbuffer.PixelBufferByte;
import java.awt.*;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Line2D;
impor... | src/main/java/com/rh12503/rendering/g2d/Graphics2DCanvas.java | 0.890235 | 0.48871 | Graphics2DCanvas.java | starcoder |
package com.rvantwisk.gcodeparser;
import com.rvantwisk.gcodeparser.exceptions.SimException;
import com.rvantwisk.gcodeparser.exceptions.SimValidationException;
import org.apache.commons.lang3.StringUtils;
import java.nio.charset.Charset;
import java.text.DecimalFormat;
import java.util.Collections;
import java.util.... | gcodeparser/src/main/java/com/rvantwisk/gcodeparser/GCodeParser.java | 0.672547 | 0.488466 | GCodeParser.java | starcoder |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.