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 q350;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.junit.runner.RunWith;
import util.runner.Answer;
import util.runner.LeetCodeRunner;
import util.runner.TestData;
import util.runner.data.DataExpectation;
import util.runner.data.TestDataFileHelpe... | src/main/java/q350/Q310_MinimumHeightTrees.java | 0.891049 | 0.613034 | Q310_MinimumHeightTrees.java | starcoder |
package io.digitalstate.stix.common;
import io.digitalstate.stix.helpers.StixDataFormats;
import java.time.Instant;
import java.util.Objects;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* Stores a Java.time Instant and stores the original sub-second precision digital count.
* SubSecond prec... | src/main/java/io/digitalstate/stix/common/StixInstant.java | 0.906074 | 0.425128 | StixInstant.java | starcoder |
package algs.model.twod;
import java.util.StringTokenizer;
import algs.model.FloatingPoint;
import algs.model.IMultiPoint;
import algs.model.IPoint;
/**
* Standard two-dimensional implementation of IPoint.
*
* For compatibility with other n-dimensional implementations, this class also
* implements {@link IMult... | reference/Algorithms-in-a-Nutshell-master/Releases/ADK/Deployment/JavaCode/src/algs/model/twod/TwoDPoint.java | 0.929776 | 0.47171 | TwoDPoint.java | starcoder |
package DataStructures;
public class SimpleHashing {
// Number of buckets by default in the list.
private static final int BUCKETS_DEFAULT = 16;
// Array of buckets.
private HashNode[] buckets;
// The actual number of buckets.
private int numBuckets;
// number of elements int he hash table.
private int size;
... | Java/DataStructures/SimpleHashing.java | 0.589835 | 0.425725 | SimpleHashing.java | starcoder |
package uk.ac.cam.cl.mlrd.exercises.markov_models;
import java.io.BufferedReader;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.function.Consumer;
import java.util.stream.Collectors;
im... | topic02/Hidden Markov Models/java/uk/ac/cam/cl/mlrd/exercises/markov_models/HMMDataStore.java | 0.85928 | 0.441914 | HMMDataStore.java | starcoder |
package io.github.vampirestudios.vks.client.render;
import io.github.vampirestudios.vks.entity.LandVehicleEntity;
/**
* Author: MrCrayfish
*/
public class Wheel
{
private float offsetX;
private float offsetY;
private float offsetZ;
private float width;
private float scaleX;
private float sca... | src/main/java/io/github/vampirestudios/vks/client/render/Wheel.java | 0.866147 | 0.419172 | Wheel.java | starcoder |
package com.genexus;
import java.io.*;
import java.util.zip.*;
import java.util.*;
public final class GXParameterPacker
{
private static final int expandSize = 512;
private int count;
private byte[] buf;
static boolean COMPRESS = true;
public GXParameterPacker()
{
this(expandSize);
}
public GXParameterP... | common/src/main/java/com/genexus/GXParameterPacker.java | 0.613931 | 0.437763 | GXParameterPacker.java | starcoder |
package org.povworld.sbb;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.povworld.collection.immutable.ImmutableList;
import org.povworld.collection.mutable.HashMap;
import org.povworld.sbb.Input.Route;
import org.povworld.sbb.Input.Route.Builder;
import org.povworld.sbb.Input.RoutePat... | test/org/povworld/sbb/RouteGraphTest.java | 0.825836 | 0.487124 | RouteGraphTest.java | starcoder |
package br.edu.sp.mackenzie.ppgeec.edo.calculator;
import java.util.ArrayList;
import java.util.List;
import br.edu.sp.mackenzie.ppgeec.ca.state.CellularAutomataState;
import br.edu.sp.mackenzie.ppgeec.ca.state.TwoDiasesState;
public class EpsilonCalculator {
public static double getE1(List<CellularAutomataState[]... | src/main/java/br/edu/sp/mackenzie/ppgeec/edo/calculator/EpsilonCalculator.java | 0.722527 | 0.651549 | EpsilonCalculator.java | starcoder |
package de.mpii.trinitreloaded.datastructures;
import java.util.ArrayList;
import de.mpii.trinitreloaded.utils.Config;
/**
* A pulsed form of a {@link MultiBucketHistogram}. It comprises of a list of
* {@code sampledValues} computed at intervals of {@code convolutionStepSize}.
*
* It also has the utility functio... | src/datastructures/PulsedMultiBucketHistogram.java | 0.762866 | 0.61144 | PulsedMultiBucketHistogram.java | starcoder |
package seedu.address.logic.parser;
import static java.util.Objects.requireNonNull;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
import seedu.address.commons.core.index.Index;
import seedu.address.commons.util.StringUtil;
import seedu.address.logic.parser.exceptions.ParseException;
im... | src/main/java/seedu/address/logic/parser/ParserUtil.java | 0.907235 | 0.429011 | ParserUtil.java | starcoder |
package com.nemosw.spigot.tap.v1_12_R1.math;
import com.google.common.collect.Lists;
import com.github.noonmaru.math.Vector;
import com.nemosw.spigot.tap.math.BoundingBox;
import net.minecraft.server.v1_12_R1.*;
import org.bukkit.craftbukkit.v1_12_R1.CraftWorld;
import org.bukkit.craftbukkit.v1_12_R1.entity.CraftEntit... | v1_12_R1/src/main/java/com/nemosw/spigot/tap/v1_12_R1/math/NMSBoundingBox.java | 0.822332 | 0.478712 | NMSBoundingBox.java | starcoder |
package com.cjburkey.radgame.world;
import com.cjburkey.radgame.chunk.VoxelChunk;
import com.cjburkey.radgame.util.math.Interpolate;
import com.cjburkey.radgame.voxel.Voxels;
import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet;
import java.util.Objects;
import org.dyn4j.geometry.Vector2;
import org.joml.AABBf;
impo... | src/main/java/com/cjburkey/radgame/world/VoxelState.java | 0.841468 | 0.425605 | VoxelState.java | starcoder |
package avalanche.data.regression.linear;
import avalanche.data.CorrelationDataset;
import avalanche.data.regression.util.RegressionEquation;
import avalanche.data.regression.util.RegressionModel;
import avalanche.data.regression.util.RegressionUtils;
import avalanche.num.Matrix;
import avalanche.num.util.MathUtils;
i... | src/avalanche/data/regression/linear/MultipleLinearRegression.java | 0.646795 | 0.800185 | MultipleLinearRegression.java | starcoder |
package nl.colorize.util;
import org.junit.jupiter.api.Test;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import stat... | test/nl/colorize/util/ReflectionUtilsTest.java | 0.861974 | 0.414543 | ReflectionUtilsTest.java | starcoder |
package com.github.liaoheng.common.util;
import android.text.TextUtils;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import androidx.annotation.NonNull;
/**
* 数字处理工具
*
* @author liaoheng
* @version 2016-12-30
*/
public class NumberUtils {
private static DecimalFormat formatDecimal2 = new D... | common-core/src/main/java/com/github/liaoheng/common/util/NumberUtils.java | 0.724286 | 0.445952 | NumberUtils.java | starcoder |
import java.util.Arrays;
import java.util.Random;
public class QuickSortOptimize {
private static final Random RANDOM = new Random(System.currentTimeMillis());
private void sort(int[] arr) {
int len = arr.length;
quickSort(arr, 0, len - 1);
}
private int partition(int[] arr, int left... | 04-Quick-Sort/04-Quick-Sort/src/QuickSortOptimize.java | 0.646906 | 0.535281 | QuickSortOptimize.java | starcoder |
import java.util.Random;
public class Futoshiki {
public static final int DEFAULT_GRIDSIZE = 5;
public int gridsize;
private int[][] squares;
private String[][] rowConstraints;
private String[][] columnConstraints;
public Futoshiki(int gridsize) {
this.gridsize = gridsize;
this... | futoshikii.java | 0.6508 | 0.450178 | futoshikii.java | starcoder |
package problem.p999availablecapturesforrook;
/**
* 999. Available Captures for Rook
*
* https://leetcode-cn.com/problems/available-captures-for-rook/
*
* On an 8 x 8 chessboard, there is exactly one white rook 'R' and some number of white bishops 'B',
* black pawns 'p', and empty squares '.'.
*
* When the roo... | leetcode-java/src/problem/p999availablecapturesforrook/Solution.java | 0.909927 | 0.414366 | Solution.java | starcoder |
package net.sqs2.image;
import java.util.HashSet;
import java.util.Set;
/**
* Silhouette extraction, set index value and calculate area value from source
* image.
*/
public class ImageSilhouetteExtract {
private static final boolean NEIGHBOR_CHECK = false;
private int width;
private int[] silhouetteIndexArray... | src/main/java/net/sqs2/image/ImageSilhouetteExtract.java | 0.786254 | 0.464537 | ImageSilhouetteExtract.java | starcoder |
package net.minecraft.src;
// Referenced classes of package net.minecraft.src:
// ModelBiped, ModelRenderer
public class ModelEnderman extends ModelBiped {
public boolean isCarrying;
public boolean isAttacking;
public ModelEnderman() {
super(0.0F, -14F);
isCarrying = false;
isAttacking = false;... | src/minecraft/net/minecraft/src/ModelEnderman.java | 0.643665 | 0.490358 | ModelEnderman.java | starcoder |
package uk.org.glendale.worldgen.astro.planets.generators.belt;
import uk.org.glendale.utils.rpg.Die;
import uk.org.glendale.worldgen.WorldGen;
import uk.org.glendale.worldgen.astro.planets.Planet;
import uk.org.glendale.worldgen.astro.planets.PlanetGenerator;
import uk.org.glendale.worldgen.astro.planets.codes.Planet... | src/main/java/uk/org/glendale/worldgen/astro/planets/generators/belt/VulcanianBelt.java | 0.696268 | 0.605682 | VulcanianBelt.java | starcoder |
package de.zib.scalaris.examples.wikipedia;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* Provides a multi-map, i.e. a map associating multiple values with a single
* key. Wraps the an arbitrary {@link Map}-class.
*
* @param <T>
... | contrib/wikipedia/src/de/zib/scalaris/examples/wikipedia/MultiMap.java | 0.931882 | 0.403978 | MultiMap.java | starcoder |
package us.ihmc.commonWalkingControlModules.bipedSupportPolygons;
import java.util.ArrayList;
import java.util.List;
import us.ihmc.commonWalkingControlModules.controllers.Updatable;
import us.ihmc.euclid.referenceFrame.FramePoint3D;
import us.ihmc.euclid.referenceFrame.FrameVector3D;
import us.ihmc.euclid.referenceF... | ihmc-common-walking-control-modules/src/main/java/us/ihmc/commonWalkingControlModules/bipedSupportPolygons/ContactPointVisualizer.java | 0.643105 | 0.557424 | ContactPointVisualizer.java | starcoder |
package org.apache.mahout.vectorizer.encoders;
import com.google.common.base.Charsets;
import com.google.common.base.Splitter;
import com.google.common.collect.HashMultiset;
import com.google.common.collect.Lists;
import com.google.common.collect.Multiset;
import org.apache.mahout.math.Vector;
import java.util.Collec... | Hadoop/apache-mahout-0.10.2-compile/mr/src/main/java/org/apache/mahout/vectorizer/encoders/TextValueEncoder.java | 0.921428 | 0.442817 | TextValueEncoder.java | starcoder |
package gov.usgs.earthquake.nshmp.geo;
import static com.google.common.base.Preconditions.checkNotNull;
import static gov.usgs.earthquake.nshmp.Earthquakes.checkDepth;
import static gov.usgs.earthquake.nshmp.geo.Coordinates.checkLatitude;
import static gov.usgs.earthquake.nshmp.geo.Coordinates.checkLongitude;
import ... | src/gov/usgs/earthquake/nshmp/geo/Location.java | 0.959221 | 0.656645 | Location.java | starcoder |
package org.cesiumjs.cs.core.geometry;
import jsinterop.annotations.JsConstructor;
import jsinterop.annotations.JsMethod;
import jsinterop.annotations.JsType;
import org.cesiumjs.cs.core.projection.MapProjection;
/**
* Content pipeline functions for geometries.
*
* @author <NAME> aka iSergio
*/
// TODO Examples
@... | cesiumjs4gwt-main/src/main/java/org/cesiumjs/cs/core/geometry/GeometryPipeline.java | 0.78374 | 0.580411 | GeometryPipeline.java | starcoder |
package es.unizar.disco.simulation.models.definition;
import org.eclipse.emf.common.util.EList;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Input Variable</b></em>'.
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* </p>
* <ul>
* <li>{@link es.unizar... | bundles/es.unizar.disco.simulation.models/src-gen/es/unizar/disco/simulation/models/definition/InputVariable.java | 0.753376 | 0.418935 | InputVariable.java | starcoder |
package org.springframework.scheduling.concurrent;
import java.util.concurrent.TimeUnit;
/**
* JavaBean that describes a scheduled executor task, consisting of
* the Runnable and a delay plus period. Period needs to be specified;
* there is no point in a default for it.
*
* <p>The JDK 1.5 ScheduledExecutorServic... | tiger/src/org/springframework/scheduling/concurrent/ScheduledExecutorTask.java | 0.87142 | 0.486819 | ScheduledExecutorTask.java | starcoder |
public class TwoThreeNode {
private int numberOfItems;
private int numberOfChildren;
private boolean isLeaf;
private TwoThreeNode parent;
private int[] items = new int[3]; //Holds a Temporary 3rd Item
private TwoThreeNode[] children = new TwoThreeNode[4]; //Holds a Temporary 4th Child
/*... | 2-3 Tree/TwoThreeNode.java | 0.891976 | 0.528168 | TwoThreeNode.java | starcoder |
package j8plus;
/**
* @author Lee, <NAME> (Kevin)
* @since 2015-07-25
*/
public class ArrayFuns {
private ArrayFuns() {
}
/**
* Checks if the given array is null or empty (length == 0)
*
* @param array the given Array of T
* @param <T> The type of element stored in the array
* @return true i... | src/main/java/j8plus/ArrayFuns.java | 0.873066 | 0.430088 | ArrayFuns.java | starcoder |
package dk.jonaslindstrom.math.algebra.concretisations;
import dk.jonaslindstrom.math.algebra.abstractions.Field;
import dk.jonaslindstrom.math.algebra.algorithms.IntegerRingEmbedding;
import dk.jonaslindstrom.math.algebra.algorithms.Multiply;
import dk.jonaslindstrom.math.algebra.algorithms.Power;
import dk.jonaslind... | src/main/java/dk/jonaslindstrom/math/algebra/concretisations/WeierstrassForm.java | 0.927969 | 0.469034 | WeierstrassForm.java | starcoder |
package jdistlib.disttest;
import java.util.HashSet;
import java.util.Set;
import jdistlib.ChiSquare;
import jdistlib.Normal;
import static java.lang.Math.PI;
import static java.lang.Math.abs;
import static java.lang.Math.asin;
import static java.lang.Math.exp;
import static java.lang.Math.log;
import static java.la... | src/main/java/jdistlib/disttest/NormalityTest.java | 0.613931 | 0.450178 | NormalityTest.java | starcoder |
package cl.uchile.dcc.scrabble.types;
import cl.uchile.dcc.scrabble.AST.INodes;
import cl.uchile.dcc.scrabble.types.numbers.SBinary;
import cl.uchile.dcc.scrabble.types.numbers.SFloat;
import cl.uchile.dcc.scrabble.types.numbers.SInteger;
public interface ITypes extends INodes {
// Transformations
/**
*... | src/main/java/cl/uchile/dcc/scrabble/types/ITypes.java | 0.781289 | 0.471284 | ITypes.java | starcoder |
package icetone.controls.lists;
import java.math.BigDecimal;
import java.math.MathContext;
import java.util.Objects;
/**
* Spinner model that takes a range of floats. This uses {@link BigDecimal}
* internally to avoid float rounding problems with small step sizes (e.g. 0.1)
*/
public class FloatRangeSpinnerModel e... | icetone-core/src/main/java/icetone/controls/lists/FloatRangeSpinnerModel.java | 0.903717 | 0.442637 | FloatRangeSpinnerModel.java | starcoder |
package gsynlib.particles;
import processing.core.*;
import static processing.core.PApplet.*;
import java.util.*;
import gsynlib.geom.QuadTreeDataVector;
public class Particle {
public int id = 0;
public float lifetime = 1f;
public float currentTime = 0f;
public Boolean live = true;
public float range = 5... | src/gsynlib/particles/Particle.java | 0.511473 | 0.453141 | Particle.java | starcoder |
import java.util.Random;
public class BST <Key extends Comparable<Key>, Value> {
private Node root = null;
private int sizeHelper(Node node) { // Size helper
if (node == null) {
return 0;
} else {
return 1 + sizeHelper(node.left) + sizeHelper(node.right);
}
}
// Returns size o... | software-systems/labs/lab10/BST.java | 0.804444 | 0.448789 | BST.java | starcoder |
package ru.semper_viventem.pixel4scanner.libs.renderer;
import android.opengl.GLSurfaceView.Renderer;
import android.opengl.GLU;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.FloatBuffer;
import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.opengles.GL10;
publi... | app/src/main/java/ru/semper_viventem/pixel4scanner/libs/renderer/PointCloudRenderer.java | 0.806396 | 0.431764 | PointCloudRenderer.java | starcoder |
package com.timofriedl.neuralnetwork.training;
import java.util.ArrayList;
import java.util.Collections;
import com.timofriedl.neuralnetwork.DNN;
/**
* An evolutionary algorithm to train deep neural networks ({@link DNN}).
*
* @author <NAME>
*/
public abstract class EvolutionaryTraining {
/**
* Trains this ... | Neural Network/src/com/timofriedl/neuralnetwork/training/EvolutionaryTraining.java | 0.903046 | 0.735143 | EvolutionaryTraining.java | starcoder |
package edu.washington.escience.myria.storage;
import java.util.Map;
import java.util.TreeMap;
import java.nio.ByteBuffer;
import org.joda.time.DateTime;
import com.google.common.base.Preconditions;
import com.google.common.collect.Maps;
import edu.washington.escience.myria.Type;
import edu.washington.escience.myria... | src/edu/washington/escience/myria/storage/ConcatColumn.java | 0.92738 | 0.404331 | ConcatColumn.java | starcoder |
package SlidingWindowMaximum_239;
import java.util.ArrayDeque;
import java.util.Deque;
/**
* Given an array nums, there is a sliding window of size k
* which is moving from the very left of the array to the very right.
* You can only see the k numbers in the window.
* Each time the sliding window moves right by o... | leetcode/src/SlidingWindowMaximum_239/Solution.java | 0.90326 | 0.450118 | Solution.java | starcoder |
package model;
import view.View;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Observable;
/**
* @author <NAME>, <NAME>, <NAME>
*/
public class BooleanModel extends Observable implements Buildable {
private boolean[][] board;
private boolean torus;
/**
* Constructor (empt... | src/model/BooleanModel.java | 0.809502 | 0.468851 | BooleanModel.java | starcoder |
package com.brightsparklabs.asanti.validator;
import com.brightsparklabs.asanti.schema.AsnBuiltinType;
import com.brightsparklabs.asanti.validator.builtin.*;
import com.brightsparklabs.asanti.validator.failure.ByteValidationFailure;
import com.google.common.collect.ImmutableSet;
/**
* Utility class for validating by... | src/main/java/com/brightsparklabs/asanti/validator/AsnByteValidator.java | 0.933945 | 0.571408 | AsnByteValidator.java | starcoder |
package com.ustwo.clockwise;
import com.ustwo.clockwise.common.WatchFaceTime;
import junit.framework.Assert;
import junit.framework.TestCase;
import java.util.TimeZone;
public class WatchFaceTimeTest extends TestCase {
private WatchFaceTime mBeginWatchFaceTime;
@Override
protected void setUp() throws E... | ustwo-clockwise/src/androidTest/java/com/ustwo/clockwise/WatchFaceTimeTest.java | 0.87991 | 0.426262 | WatchFaceTimeTest.java | starcoder |
package com.flowpowered.noise.module.transformer;
import com.flowpowered.math.TrigMath;
import com.flowpowered.noise.module.Modifier;
import com.flowpowered.noise.module.Module;
public class RotatePoint extends Modifier {
// Rotation angles
private final double xAngle;
private final double yAngle;
p... | src/main/java/com/flowpowered/noise/module/transformer/RotatePoint.java | 0.924734 | 0.700011 | RotatePoint.java | starcoder |
package Programmiertechnik_I;
public class Aufgabe8 {
// 8.1
// Schreiben Sie eine Methode, die die Inhalte eines eindimensionalen
// Integer-Arrays auf der Konsole ausgibt.
public void print81(int[] array) {
for (int i : array) {
System.out.print(i + " ");
}
System.out.println();
}
// ... | Programmiertechnik_I/Aufgabe8.java | 0.519034 | 0.47317 | Aufgabe8.java | starcoder |
package io.tourniquet.junit.net;
public final class NetworkMatchers {
private NetworkMatchers() {
}
/**
* Matcher to verify if a {@link NetworkPort} is available to be used as server port.
*
* @return a matcher to verify the avilability of a port
*/
public static ResourceAvailabi... | tourniquet-net/src/main/java/io/tourniquet/junit/net/NetworkMatchers.java | 0.893713 | 0.567817 | NetworkMatchers.java | starcoder |
package org.jwatter.util;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io... | tests/java/org/jwatter/util/OrderedPropertiesTest.java | 0.732783 | 0.409752 | OrderedPropertiesTest.java | starcoder |
package UC4.Exercise_01;
import java.util.Stack;
public class Example_01 {
public static void main(String[] args) {
Input input = new Input();
Output output = new Output();
String expression = readPostFixExpression(input, output);
evaluatePostFixExpression(expression, output);
... | src/UC4/Exercise_01/Example_01.java | 0.661158 | 0.491151 | Example_01.java | starcoder |
package hr.fer.zemris.java.hw01;
import java.util.Scanner;
/**
* The program adds unique numbers to the ordered binary tree.
* You can print the number of a nodes in the tree, check whether the tree contains a certain element,
* print nodes from the smallest element to the largest and vice versa.
* @author <NAME>... | HW01/src/main/java/hr/fer/zemris/java/hw01/UniqueNumbers.java | 0.830869 | 0.510313 | UniqueNumbers.java | starcoder |
package jam.math;
/**
* Maps continuous coordinates onto a lattice of discrete points
* indexed by an integral value.
*
* <p>A discretization is defined by a <em>resolution</em>, the
* distance between adjacent lattice points.
*/
public final class Discretization {
private final double resolution;
/**
... | src/main/java/jam/math/Discretization.java | 0.971469 | 0.786787 | Discretization.java | starcoder |
package io.luna.util;
import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableList;
import static com.google.common.base.Preconditions.checkArgument;
/**
* A static-utility class that contains functions for manipulating strings.
*
* @author lare96 <http://github.org/lare96>
*/
public fina... | src/main/java/io/luna/util/StringUtils.java | 0.881283 | 0.402744 | StringUtils.java | starcoder |
package com.libreworks.stellarbase.text;
import com.google.common.base.CharMatcher;
import com.libreworks.stellarbase.util.Arguments;
/**
* An immutable object which trims the whitespace from CharSequence objects.
*
* <p>A Trimmer can be configured to trim just the leading whitespace, just the
* trailing whitesp... | stellarbase-core/src/main/java/com/libreworks/stellarbase/text/Trimmer.java | 0.937031 | 0.407098 | Trimmer.java | starcoder |
package com.pspdfkit.labs.vangogh.base;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import android.view.View;
import android.view.animation.Interpolator;
import com.pspdfkit.labs.vangogh.rx.AnimationCompletable;
import java.lang.ref.WeakReference;
/**
* Holds parameters for view animati... | vangogh/src/main/java/com/pspdfkit/labs/vangogh/base/Animation.java | 0.948227 | 0.414543 | Animation.java | starcoder |
package com.juliovedovatto.animalsgame;
/**
* Node tree class. Consists in a main node, a left node and a right node.
* it' like a chain of nodes. Where every answer leads to a new node.
* @author <NAME> (<EMAIL>)
*/
public class Node {
private Node parent_node, right_node, left_node;
private St... | src/com/juliovedovatto/animalsgame/Node.java | 0.901176 | 0.428532 | Node.java | starcoder |
package net.fabricmc.fabric.api.biomes.v1;
import java.util.Collection;
import com.google.common.collect.Lists;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.layer.LayerRandomnessSource;
/**
* A predicate of a biome collection and randomness source. Tests whether the conditions for gener... | fabric-biomes-v1/src/main/java/net/fabricmc/fabric/api/biomes/v1/BiomeNeighborsPredicate.java | 0.861524 | 0.456773 | BiomeNeighborsPredicate.java | starcoder |
package genlib.standard.operators;
import genlib.abstractrepresentation.AlgorithmPass;
import genlib.abstractrepresentation.AlgorithmStep;
import genlib.abstractrepresentation.GenInstance;
import genlib.abstractrepresentation.GenObject;
import genlib.abstractrepresentation.GenObject.AttributeType.Type;
import genlib.a... | src/genlib/standard/operators/ArithmeticRecombination.java | 0.882212 | 0.424352 | ArithmeticRecombination.java | starcoder |
package com.revolsys.geometry.index;
import com.revolsys.geometry.model.BoundingBox;
import com.revolsys.geometry.util.RectangleUtil;
import com.revolsys.util.Property;
public class BoundingBoxNode {
private double maxX;
private double maxY;
private double minX;
private double minY;
public BoundingBoxNo... | revolsys-core/src/main/java/com/revolsys/geometry/index/BoundingBoxNode.java | 0.916624 | 0.458773 | BoundingBoxNode.java | starcoder |
package org.powerflows.dmn.engine.evaluator.expression.provider.feel.converter.mvel;
import org.powerflows.dmn.engine.evaluator.expression.ExpressionEvaluationException;
import org.powerflows.dmn.engine.evaluator.expression.provider.feel.converter.ExpressionConverter;
import java.util.ArrayList;
import java.util.List... | dmn-feel-evaluation-provider/src/main/java/org/powerflows/dmn/engine/evaluator/expression/provider/feel/converter/mvel/FeelToMvelCollectionExpressionConverter.java | 0.87633 | 0.457197 | FeelToMvelCollectionExpressionConverter.java | starcoder |
package org.jenetics.internal.math;
import static java.lang.Math.abs;
import static java.lang.Math.nextDown;
import static java.lang.String.format;
import static org.jenetics.internal.util.require.probability;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Random;
import java.util.stream.I... | org.jenetics/src/main/java/org/jenetics/internal/math/random.java | 0.944151 | 0.534916 | random.java | starcoder |
package io.gameoftrades.student49.algorithm.traderoute;
/**
* Population class.
*/
class TradePopulation {
/**
* List of individuals that are part of this population.
*/
private TradeIndividual[] population;
/**
* Maximum number of actions the individuals in this population can perform.
... | src/main/java/io/gameoftrades/student49/algorithm/traderoute/TradePopulation.java | 0.906502 | 0.44903 | TradePopulation.java | starcoder |
package paulevs.edenring.blocks.entities.renderers;
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import com.mojang.math.Matrix3f;
import com.mojang.math.Matrix4f;
import net.minecraft.client.renderer.MultiBufferSource;
impo... | src/main/java/paulevs/edenring/blocks/entities/renderers/EdenPortalBlockEntityRenderer.java | 0.554953 | 0.412885 | EdenPortalBlockEntityRenderer.java | starcoder |
package net.glowstone.util;
import com.flowpowered.math.vector.Vector3d;
import com.flowpowered.math.vector.Vector3i;
import org.spongepowered.api.world.Location;
public class MutableVector {
private double x, y, z;
public MutableVector(Vector3d position) {
this(position.getX(), position.getY(), posi... | src/main/java/net/glowstone/util/MutableVector.java | 0.861305 | 0.747662 | MutableVector.java | starcoder |
package com.github.llamarama.team.client.entity.woollyllama;
import com.github.llamarama.team.entity.woolyllama.WoollyLlamaEntity;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.model.*;
import net.minecraft.client.render.VertexConsumer;
import net.minecraft.client.re... | src/main/java/com/github/llamarama/team/client/entity/woollyllama/WoollyLlamaEntityModel.java | 0.792143 | 0.417865 | WoollyLlamaEntityModel.java | starcoder |
package com.engine.world;
import java.util.Vector;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.physics.box2d.Body;
import com.badlogic.gdx.physics.box2d.Shape;
import com.badlogic.gdx.physics.box2d.World;
import com.badlogic.gdx.physics.box2d.BodyDef.BodyType;
import com.engine.math.Vec;
public cl... | core/src/com/engine/world/DynamicBody2D.java | 0.792384 | 0.475605 | DynamicBody2D.java | starcoder |
package com.softhale.day08;
import com.softhale.utils.ParserUtils;
import com.softhale.utils.StringUtils;
import java.util.*;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
public class Day08 {
private final ParserUtils... | src/main/java/com/softhale/day08/Day08.java | 0.870046 | 0.446314 | Day08.java | starcoder |
package com.opengamma.bbg.util;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import com.opengamma.OpenGammaRuntimeException;
import com.opengamma.core.id.ExternalSchemes;
import com.opengamma.id.ExternalId;
/**
* <p>
* Base class for Bloomberg ticker parsing. The rationale for having this parsin... | projects/bloomberg/src/main/java/com/opengamma/bbg/util/BloombergTickerParser.java | 0.867022 | 0.470676 | BloombergTickerParser.java | starcoder |
package smile.sequence;
import java.util.Arrays;
import java.util.Properties;
import java.util.function.Function;
import smile.data.Tuple;
/**
* First-order CRF sequence labeler.
*
* @author <NAME>
*/
public class CRFLabeler<T> implements SequenceLabeler<T> {
private static final long serialVersionUID = 2L;
... | core/src/main/java/smile/sequence/CRFLabeler.java | 0.963049 | 0.673877 | CRFLabeler.java | starcoder |
package edu.wpi.first.math.controller;
import edu.wpi.first.math.MatBuilder;
import edu.wpi.first.math.Nat;
import edu.wpi.first.math.numbers.N2;
import edu.wpi.first.math.system.LinearSystem;
/**
* Filters the provided voltages to limit a differential drive's linear and angular acceleration.
*
* <p>The different... | wpimath/src/main/java/edu/wpi/first/math/controller/DifferentialDriveAccelerationLimiter.java | 0.959564 | 0.530905 | DifferentialDriveAccelerationLimiter.java | starcoder |
package com.github.koettlitz.util;
import java.util.NoSuchElementException;
import java.util.Objects;
/**
* A {@link PeekableIterator} which iterates over an array.
* Class contains factory methods to create instances.
*
* @param <E> The element type
*
* @author <NAME>
* <br>Erstellt am 07.08.2017
*/
public c... | src/main/java/com/github/koettlitz/util/ArrayIterator.java | 0.959913 | 0.558447 | ArrayIterator.java | starcoder |
package perococco.aoc.day16;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import lombok.NonNull;
import perococco.aoc.common.AOCException;
import perococco.aoc.common.Tools;
import java.util.HashSet;
import java.util.Map;
import java.util.Optional;
import java.util.Set... | perococco.aoc.problems/perococco.aoc.day16/src/main/java/perococco/aoc/day16/FieldsMatcher.java | 0.892776 | 0.4206 | FieldsMatcher.java | starcoder |
package thistle.suite;
import com.google.common.collect.ImmutableList;
import thistle.core.*;
import java.util.ArrayList;
import java.util.List;
public class Specification implements Describable {
public final String description;
public final Block initialisation;
public final ImmutableList<WhenBlock> p... | src/main/java/thistle/suite/Specification.java | 0.855565 | 0.432363 | Specification.java | starcoder |
package gov.sandia.cognition.learning.algorithm.clustering.divergence;
import gov.sandia.cognition.learning.algorithm.clustering.cluster.DefaultCluster;
import gov.sandia.cognition.learning.function.distance.EuclideanDistanceMetric;
import gov.sandia.cognition.math.matrix.Vector;
import gov.sandia.cognition.math.matri... | Components/LearningCore/Test/gov/sandia/cognition/learning/algorithm/clustering/divergence/ClusterMeanLinkDivergenceFunctionTest.java | 0.927618 | 0.734524 | ClusterMeanLinkDivergenceFunctionTest.java | starcoder |
package channels;
import com.google.protobuf.ByteString;
import java.math.BigInteger;
import org.junit.Assert;
import org.junit.Test;
import snowblossom.channels.HashMath;
import snowblossom.lib.HexUtil;
public class HashMathTest
{
@Test
public void testAbsBasic()
{
ByteString a = HexUtil.hexStringToBytes("... | test/HashMathTest.java | 0.844345 | 0.492127 | HashMathTest.java | starcoder |
package org.nschmidt.ldparteditor.helper.math;
import java.math.BigDecimal;
import org.lwjgl.util.vector.Matrix4f;
/**
* Immutable, absolute precision matrix class
*
* @author nils
*
*/
public class RationalMatrix {
private final Rational[][] m = new Rational[4][4];
public RationalMatrix(Matrix4f m) {... | src/org/nschmidt/ldparteditor/helper/math/RationalMatrix.java | 0.637031 | 0.587647 | RationalMatrix.java | starcoder |
package org.requirementsascode.builder;
import static org.requirementsascode.builder.FlowlessConditionPart.flowlessConditionPart;
import java.util.Objects;
import org.requirementsascode.Behavior;
import org.requirementsascode.Condition;
import org.requirementsascode.Model;
public class FlowlessToPart {
private Use... | requirementsascodecore/src/main/java/org/requirementsascode/builder/FlowlessToPart.java | 0.808332 | 0.509459 | FlowlessToPart.java | starcoder |
package ru.icbcom.aistdapsdkjava.api.measureddata;
import ru.icbcom.aistdapsdkjava.api.resource.Resource;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.time.LocalDateTime;
/**
* Измерение.
*/
public interface MeasuredData extends Resource {
/**
* Возвращает идентификатор источника... | src/main/java/ru/icbcom/aistdapsdkjava/api/measureddata/MeasuredData.java | 0.553988 | 0.562297 | MeasuredData.java | starcoder |
package Graph_NC_RE;
import org.apache.commons.math3.stat.correlation.PearsonsCorrelation;
import org.apache.commons.math3.stat.descriptive.moment.Mean;
import org.apache.commons.math3.stat.descriptive.moment.StandardDeviation;
import org.apache.commons.math3.stat.descriptive.moment.Variance;
import java.io.FileNotFo... | app/src/main/java/Graph_NC_RE/Utilities.java | 0.723895 | 0.516535 | Utilities.java | starcoder |
package org.deviceconnect.android.deviceplugin.theta.utils;
public class Vector3D {
private static final int SIZE = 3;
private final float[] mCoods = new float[SIZE];
public Vector3D(final float x, final float y, final float z) {
mCoods[0] = x;
mCoods[1] = y;
mCoods[2] = z;
}
... | Android/dConnectDeviceTheta/app/src/main/java/org/deviceconnect/android/deviceplugin/theta/utils/Vector3D.java | 0.914551 | 0.674565 | Vector3D.java | starcoder |
package com.github.tm.stindex;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
/**
* Defines a unit interval on a number line.
*
* @author <NAME>
* */
public class ByteArrayRange implements Comparable<ByteArrayRange> {
public... | src/main/java/com/github/tm/stindex/ByteArrayRange.java | 0.924232 | 0.422922 | ByteArrayRange.java | starcoder |
package math;
import java.nio.FloatBuffer;
import org.lwjgl.BufferUtils;
/**
* @author <NAME>
*/
public class Matrix3 {
public static final int LENGTH = 9;
private float[] matrix = new float[LENGTH];
public Matrix3() {
clearToIdentity();
}
public Matrix3(float[] m) {
this();
set(m);
}
public Matri... | src/main/java/math/Matrix3.java | 0.852399 | 0.540014 | Matrix3.java | starcoder |
import java.util.Scanner;
public class EX33_PolygonSubareas {
public static void main(String[] args) {
System.out.println("Enter x1, y1, x2, y2, x3, y3, x4, y4: ");
double[][] points = getMatrix();
double[] intersectPoint = getIntersectingPoint(points);
... | CH08/EX33_PolygonSubareas/EX33_PolygonSubareas.java | 0.525856 | 0.639567 | EX33_PolygonSubareas.java | starcoder |
public class NthElementInLinkedList {
private static class Node {
int value;
Node child;
Node(int value, Node child) {
this.value = value;
this.child = child;
}
@Override
public String toString() {
return String.valueOf(value);
... | src/main/java/NthElementInLinkedList.java | 0.81409 | 0.430207 | NthElementInLinkedList.java | starcoder |
package game;
import static java.util.Collections.*;
import static game.LocalCount.*;
import java.util.Collection;
import java.util.Set;
import java.util.stream.Collectors;
/**
* Look ahead at other free squares on the board to try out if candidate may be a viable one.
*
* @author Lawrence
*
*/
final class Loo... | src/main/java/game/LookAhead.java | 0.725649 | 0.424531 | LookAhead.java | starcoder |
package com.github.iunius118.tolaserblade.client.renderer.item.model;
import com.mojang.math.Vector3f;
import net.minecraft.client.renderer.block.model.ItemTransform;
import net.minecraft.client.renderer.block.model.ItemTransforms;
@SuppressWarnings("deprecation") // For ItemCameraTransforms and ItemCameraTransform
p... | src/main/java/com/github/iunius118/tolaserblade/client/renderer/item/model/LBSwordItemTransforms.java | 0.703244 | 0.454048 | LBSwordItemTransforms.java | starcoder |
package binary_search_tree;
/**
*
* @author Polis
*/
public class BSTree {
private TreeNode root;
public BSTree() {
root = null;
}
public TreeNode getRoot() {
return root;
}
public boolean isEmpty() {
return (root == null);
}
public void insertElem... | Lab8-BinarySearchTree/src/binary_search_tree/BSTree.java | 0.663233 | 0.480844 | BSTree.java | starcoder |
package com.cordys.coe.ac.fileconnector.utils;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* An utility class to check match if a string matches the beginning of a regular expression. Can be
* used to find early matches while going though substrings that are part of the final string t... | src/cws/FileConnector/com-cordys-coe/fileconnector/java/source/com/cordys/coe/ac/fileconnector/utils/PartialMatcher.java | 0.803983 | 0.475727 | PartialMatcher.java | starcoder |
package day_16;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
public... | day_16/Main.java | 0.793746 | 0.413063 | Main.java | starcoder |
package com.b2international.snowowl.fhir.core.codesystems;
import com.b2international.snowowl.fhir.core.ResourceNarrative;
import com.fasterxml.jackson.annotation.JsonCreator;
/**
* FHIR Concept Map Equivalence code system
* @since 7.1
*/
@ResourceNarrative("The degree of equivalence between codes.")
public enum C... | fhir/com.b2international.snowowl.fhir.core/src/com/b2international/snowowl/fhir/core/codesystems/ConceptMapEquivalence.java | 0.762778 | 0.438605 | ConceptMapEquivalence.java | starcoder |
package org.openimaj.image.camera.calibration;
import static java.lang.Math.cos;
import static java.lang.Math.pow;
import static java.lang.Math.sin;
import static java.lang.Math.sqrt;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.math3.analysis.MultivariateMatrixFunction;
import org.ap... | image/camera-calibration/src/main/java/org/openimaj/image/camera/calibration/CameraCalibration.java | 0.844216 | 0.515681 | CameraCalibration.java | starcoder |
package model;
import java.awt.Graphics;
import java.awt.Color;
/**
* This class describes a shot/bullet object which is a subclass of shape. It contains methods to move and reset
* the shot, and detect its collision with other shapes.
*/
public class Shot extends Shape {
private boolean shotFired = false;
/... | compsci courses/CPSC233 - CPSC 233 - Intro to CompSci in Java /finalProject/SpaceInvaders/main/model/Shot.java | 0.799129 | 0.468122 | Shot.java | starcoder |
package cn.mghio.leetcode.array;
/**
* Write an efficient algorithm that searches for a target value in an m x n integer matrix. The
* matrix has the following properties:
*
* Integers in each row are sorted in ascending from left to right. Integers in each column are
* sorted in ascending from top to bottom.
*
... | src/main/java/cn/mghio/leetcode/array/SearchMatrix.java | 0.931455 | 0.664255 | SearchMatrix.java | starcoder |
package ibot.vectors;
import ibot.bot.utils.maths.Atan2;
import ibot.bot.utils.maths.MathsUtils;
import ibot.bot.utils.rl.Constants;
public class Vector2 {
public static Vector2 X = new Vector2(1, 0);
public static Vector2 Y = new Vector2(0, 1);
public final double x;
public final double y;
public Vector2(dou... | src/main/java/ibot/vectors/Vector2.java | 0.824744 | 0.824108 | Vector2.java | starcoder |
package com.refinedmods.refinedstorage2.platform.fabric.render.model.baked.transform;
import com.refinedmods.refinedstorage2.platform.common.util.BiDirection;
import com.mojang.math.Matrix4f;
import com.mojang.math.Quaternion;
import com.mojang.math.Vector3f;
import com.mojang.math.Vector4f;
import net.fabricmc.fabri... | refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/render/model/baked/transform/QuadRotator.java | 0.786746 | 0.464476 | QuadRotator.java | starcoder |
package de.i3mainz.ibr.math;
public class Matrix {
double[][] a;
public Matrix(double ... a) {
int s=0;
while(a.length > s*s) {
s++;
}
if (s*s != a.length)
throw new DimensionMismatchException("matrix must be cubic, but has " + a.length + " entries instead");
this.a = new double[s][s];
for (int... | spatialstore/src/main/java/de/i3mainz/ibr/math/Matrix.java | 0.558086 | 0.41834 | Matrix.java | starcoder |
package org.at4j.support.lang;
import java.io.IOException;
import java.io.InputStream;
import java.io.Serializable;
import org.entityfs.RandomAccess;
import org.entityfs.exception.UnexpectedEofException;
import org.entityfs.support.exception.WrappedIOException;
/**
* This object represents an unsigned integer (four... | src/AT4J_support/src/org/at4j/support/lang/UnsignedInteger.java | 0.955277 | 0.496704 | UnsignedInteger.java | starcoder |
package us.ihmc.robotics.screwTheory;
import org.ejml.data.DenseMatrix64F;
import org.ejml.ops.CommonOps;
import us.ihmc.robotics.linearAlgebra.MatrixTools;
import us.ihmc.robotics.referenceFrames.ReferenceFrame;
import java.util.ArrayList;
import java.util.LinkedHashMap;
/**
* Very inefficient. Should only be used... | IHMCRoboticsToolkit/src/us/ihmc/robotics/screwTheory/DifferentialIDMassMatrixCalculator.java | 0.853882 | 0.594316 | DifferentialIDMassMatrixCalculator.java | starcoder |
package co.edu.uniandes.csw.fotografia.resources;
import co.edu.uniandes.csw.fotografia.dtos.FacturaDTO;
import co.edu.uniandes.csw.fotografia.ejb.ClienteFacturasLogic;
import co.edu.uniandes.csw.fotografia.ejb.FacturaLogic;
import co.edu.uniandes.csw.fotografia.entities.FacturaEntity;
import co.edu.uniandes.csw.fotog... | s2_fotografia-api/src/main/java/co/edu/uniandes/csw/fotografia/resources/ClienteFacturasResource.java | 0.672547 | 0.499084 | ClienteFacturasResource.java | starcoder |
package com.freetymekiyan.algorithms.level.easy;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
/**
* Say you have an array for which the ith element is the price of a given stock on day i.
* <p>
* If you were only permitted to complete at most one transaction (ie,... | src/main/java/com/freetymekiyan/algorithms/level/easy/BestTimeToBuyAndSellStock.java | 0.874493 | 0.635703 | BestTimeToBuyAndSellStock.java | starcoder |
package org.locationtech.jts.awt;
import java.awt.Rectangle;
import java.awt.Shape;
import java.awt.geom.AffineTransform;
import java.awt.geom.GeneralPath;
import java.awt.geom.PathIterator;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
import java.util.Collection;
import java.util.Iterator;
import ... | src/main/java/org/locationtech/jts/awt/PolygonShape.java | 0.928676 | 0.498169 | PolygonShape.java | starcoder |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.