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 |
|---|---|---|---|---|---|
class Solution {
public int ladderLength(String beginWord, String endWord, List<String> wordList) {
// Impossible case here, but zero transformation yields 1, not 0.
if (beginWord.equals(endWord)) {
return 1;
}
// Convert input list to set for quick lookup.
... | code/Word Ladder.java | 0.807574 | 0.434881 | Word Ladder.java | starcoder |
package crafttweaker.api.data;
import crafttweaker.annotations.ZenRegister;
import stanhebben.zenscript.annotations.*;
import java.util.*;
/**
* Generic data interface. A data element may contain any kind of basic data
* element (bool, byte, short, int, long, float, double, string, list, map, int
* array or byte ... | CraftTweaker2-API/src/main/java/crafttweaker/api/data/IData.java | 0.716516 | 0.461623 | IData.java | starcoder |
package com.qcloud.cos.common_utils;
/**
* 求sha1, 未使用JAVA自带类,是为了获取分片的中间状态(state数组)
* @author chengwu
*
*/
public final class CommonSha1Utils {
private int state[] = new int[5];
private long count;
public byte[] digestBits;
public boolean digestValid;
public CommonSha1Utils() {
state =... | src/main/java/com/qcloud/cos/common_utils/CommonSha1Utils.java | 0.627267 | 0.492554 | CommonSha1Utils.java | starcoder |
package com.edinarobotics.utils.sensors;
import com.sun.squawk.util.MathUtils;
/**
* takes a series of values and smooths them using FIR filtering
*
*/
public class FIRFilter implements FilterDouble{
private double[] tapWeights;
private double[] values;
/**
* constructs a FIR filter that has weig... | src/com/edinarobotics/utils/sensors/FIRFilter.java | 0.862771 | 0.596022 | FIRFilter.java | starcoder |
package com.github.ambry.router;
/**
* Represents a byte range for performing ranged get requests.
*/
public class ByteRange {
private static final long UNDEFINED_OFFSET = -1;
private final ByteRangeType type;
private final long startOffset;
private final long endOffset;
/**
* Construct a range from a... | ambry-api/src/main/java/com.github.ambry/router/ByteRange.java | 0.974976 | 0.459561 | ByteRange.java | starcoder |
package org.bouncycastle.math.ec.custom.sec;
import java.math.BigInteger;
import org.bouncycastle.math.raw.Nat;
import org.bouncycastle.math.raw.Nat256;
public class SecP256K1Field {
static final int[] P = new int[]{-977, -2, -1, -1, -1, -1, -1, -1};
static final int[] PExt = new int[]{954529, 1954, 1, 0, 0, ... | terminalapp/org/bouncycastle/math/ec/custom/sec/SecP256K1Field.java | 0.712232 | 0.434341 | SecP256K1Field.java | starcoder |
package scratch.UCERF3.erf.ETAS;
import java.util.Arrays;
import java.util.Collection;
import org.opensha.commons.data.function.IntegerPDF_FunctionSampler;
import com.google.common.base.Preconditions;
import com.google.common.primitives.Ints;
/**
* Efficient data store for nucleation rates for each source on a giv... | src/main/java/scratch/UCERF3/erf/ETAS/SectionSourceNuclRates.java | 0.79956 | 0.451447 | SectionSourceNuclRates.java | starcoder |
package com.opengamma.analytics.financial.horizon;
import org.threeten.bp.ZonedDateTime;
import com.opengamma.analytics.financial.instrument.swaption.SwaptionCashFixedIborDefinition;
import com.opengamma.analytics.financial.interestrate.PresentValueBlackCalculator;
import com.opengamma.analytics.financial.interestrat... | projects/OG-Analytics/src/main/java/com/opengamma/analytics/financial/horizon/CashSwaptionBlackConstantSpreadHorizonCalculator.java | 0.834339 | 0.494202 | CashSwaptionBlackConstantSpreadHorizonCalculator.java | starcoder |
package org.arp.javautil.arrays;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
* Utilities for arrays.
*
* @author <NAME>
*
*/
public final class Arrays {
/**
* Private constructor.
*/
private Arrays() {
... | src/main/java/org/arp/javautil/arrays/Arrays.java | 0.892574 | 0.404243 | Arrays.java | starcoder |
package fr.delthas.javaui;
/**
* FontMetrics stores metrics relative to a font and font size, that may be useful to components that need to draw and process text.
* <p>
* All metrics are in pixels.
*
* @see #getLineHeight()
*/
public class FontMetrics {
private final float ascent;
private final float descent... | src/main/java/fr/delthas/javaui/FontMetrics.java | 0.919998 | 0.475605 | FontMetrics.java | starcoder |
package lfsom.visualization.clustering;
import java.util.Vector;
import lfsom.layers.metrics.LFSL2Metric;
import lfsom.util.LFSException;
public class LFSCluster {
private Vector<Integer> indices;
private double[] centroid;
public LFSCluster() {
indices = new Vector<Integer>();
}
LFSCluster(double[] cent... | lfsom/src/lfsom/visualization/clustering/LFSCluster.java | 0.703244 | 0.604837 | LFSCluster.java | starcoder |
package frc.robot;
import java.util.HashMap;
import java.util.Map;
import com.ctre.phoenix.motorcontrol.TalonFXInvertType;
import edu.wpi.first.wpilibj.DoubleSolenoid;
import edu.wpi.first.wpilibj.DoubleSolenoid.Value;
import frc.robot.enums.Climb.HookPositions;
import frc.robot.enums.Climb.LockPositions;
import fr... | src/main/java/frc/robot/Constants.java | 0.691706 | 0.403302 | Constants.java | starcoder |
package com.csingh.datastructure.problems;
public class NthDigitOfInfiniteNumberSeries {
public static int getNthDigit(int n) {
if (n < 10) {
return n;
}
StringBuilder sb = new StringBuilder();
for (int i = 1; i <= n; i++) {
sb.append(i);
}
System.out.println(sb.toString());
return Character.getN... | datastructure/problems/NthDigitOfInfiniteNumberSeries.java | 0.646795 | 0.405566 | NthDigitOfInfiniteNumberSeries.java | starcoder |
import java.util.*;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
public class TestInterComputer {
@BeforeClass
public static void beforeTests() {
System.out.println("\n------------------------------");
System.out.println("Testing class Inte... | prototyping/Java/TestInterComputer.java | 0.715424 | 0.499756 | TestInterComputer.java | starcoder |
package org.eclipse.jgit.treewalk;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.time.Instant;
import org.junit.Test;
public class InstantComparatorTest {
private final InstantComparator cmp = new InstantComparator();
@Test
public void compareNow() {
Inst... | org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/InstantComparatorTest.java | 0.833257 | 0.736282 | InstantComparatorTest.java | starcoder |
package fr.univamu.asteroid.view;
import fr.univamu.asteroid.game.Asteroid;
import fr.univamu.asteroid.game.Projectile;
import fr.univamu.asteroid.game.Score;
import fr.univamu.asteroid.game.Spaceship;
import javafx.scene.canvas.Canvas;
import javafx.scene.canvas.GraphicsContext;
import javafx.scene.image.Image;
impor... | Licence 1/Asteroids/src/fr/univamu/asteroid/view/CanvasView.java | 0.785514 | 0.410934 | CanvasView.java | starcoder |
package com.mccarthy.control;
import org.ejml.simple.SimpleMatrix;
public class ss {
protected SimpleMatrix _A;
protected SimpleMatrix _B;
protected SimpleMatrix _C;
protected SimpleMatrix _D;
protected double _dt = -1; // Discrete Time state space
/**
* Create a continus time state spa... | src/main/java/com/mccarthy/control/ss.java | 0.899365 | 0.628707 | ss.java | starcoder |
import java.lang.Math;
/**
* Name: GravField
* Purpose: To simulate the gravitational field of a body
*
* @author <NAME>
* @version 1.0
* Date: 27.11.2017
*
*/
public class GravField
{
private static final double G = 6.67408e-11; // Gravitational constant
private double mBody; // Mass of body
pri... | SolarSystemSim/GravField.java | 0.948537 | 0.801664 | GravField.java | starcoder |
* package for storage and manipulation of seismic earth models.
*
*/
package edu.sc.seis.TauP;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.Reader;
import java.io.Serializable;
import... | SYNTOMO/TauP-2.4.5/src/main/java/edu/sc/seis/TauP/VelocityModel.java | 0.898081 | 0.411732 | VelocityModel.java | starcoder |
package sun.security.ec;
import sun.security.util.ObjectIdentifier;
import sun.security.x509.AlgorithmId;
import java.security.spec.AlgorithmParameterSpec;
import java.security.spec.NamedParameterSpec;
import java.util.Collections;
import java.util.Map;
import java.util.HashMap;
import java.util.Optional;
import java... | src/jdk.crypto.ec/share/classes/sun/security/ec/ParametersMap.java | 0.837587 | 0.416559 | ParametersMap.java | starcoder |
package hhtat.game.ois.math;
public class Vector3 {
protected double x;
protected double y;
protected double z;
public Vector3() {
this( 0.0, 0.0, 0.0 );
}
public Vector3( double x, double y, double z ) {
this.x = x;
this.y = y;
this.z = z;
}
public Vector3( Vector3 vector ) {
th... | src/hhtat/game/ois/math/Vector3.java | 0.900582 | 0.686465 | Vector3.java | starcoder |
package six_kyu;
import java.util.Arrays;
/**
* Given two arrays a and b write a function comp(a, b) (compSame(a, b) in Clojure) that checks whether the two arrays
* have the "same" elements, with the same multiplicities. "Same" means, here, that the elements in b are the elements
* in a squared, regardless of the... | src/six_kyu/Are_they_the_same.java | 0.774199 | 0.486149 | Are_they_the_same.java | starcoder |
package de.jtem.blas;
import java.io.Serializable;
import de.jtem.mfc.field.Complex;
import de.jtem.mfc.field.ComplexConstant;
import de.jtem.mfc.field.Field;
abstract class AbstractMatrix implements Serializable,Cloneable
{
private static final long serialVersionUID = 1L;
// are entries equal ? a "=" b ... | libUnzipped/de/jtem/blas/AbstractMatrix.java | 0.700485 | 0.476945 | AbstractMatrix.java | starcoder |
package edu.udel.cis.vsl.gmc.concurrent;
public class ConcurrentNode<STATE> {
private STATE state;
private int[] onStack = new int[2
* Runtime.getRuntime().availableProcessors()];
private boolean fullyExplored = false;
private ProvisoValue proviso = ProvisoValue.UNKNOWN;
public ConcurrentNode(STATE state)... | src/edu/udel/cis/vsl/gmc/concurrent/ConcurrentNode.java | 0.783823 | 0.437884 | ConcurrentNode.java | starcoder |
package de.lmu.ifi.dbs.elki.distance.distancefunction;
import de.lmu.ifi.dbs.elki.data.NumberVector;
import de.lmu.ifi.dbs.elki.data.VectorUtil;
import de.lmu.ifi.dbs.elki.data.spatial.SpatialComparable;
import de.lmu.ifi.dbs.elki.data.type.SimpleTypeInformation;
import de.lmu.ifi.dbs.elki.utilities.optionhandling.Abs... | elki-0.7.5/sources/elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/distancefunction/ArcCosineUnitlengthDistanceFunction.java | 0.890984 | 0.566678 | ArcCosineUnitlengthDistanceFunction.java | starcoder |
package numericalmethods;
/**
* Author: <NAME>
* Date of creation: 8 May 2018
*
* The Body class represents a mass with some velocity and position vector. It is meant to be used with the Nbody class.
* It contains methods to get and set velocity, position, and mass values. It can additionally find a relat... | Body.java | 0.901412 | 0.696494 | Body.java | starcoder |
import java.awt.Rectangle;
import java.util.ArrayList;
public class Collision {
private int[][] map;
private ArrayList<Rectangle> solidWalls = new ArrayList<>();
private ArrayList<Rectangle> destructibleWalls = new ArrayList<>();
public Collision(TileLayer layer) {
map = layer.getMap();
... | tankgame/src/Collision.java | 0.588416 | 0.466967 | Collision.java | starcoder |
package hr.fer.zemris.java.graphics.shapes;
/**
* A simple oval {@code GeometricShape} that has the center on the coordinate
* (x, y) and a horizontal and vertical radius. Depending on the implementation,
* changing the horizontal radius may or may not change the vertical radius. The
* same applies for the vertica... | HW04 - OOP Inheritance and Polymorphism/src/hr/fer/zemris/java/graphics/shapes/Oval.java | 0.952031 | 0.796372 | Oval.java | starcoder |
import java.util.Iterator;
import data_structures.*;
public class LatinDictionary {
private DictionaryADT<String, String> dictionary;
/**
* constructor takes no arguments. Size depends on the datafile.
* creates an instance of the DictionaryADT. Use your HashTable
* implementation in this cla... | src/prog3/LatinDictionary.java | 0.90201 | 0.437763 | LatinDictionary.java | starcoder |
package com.freetymekiyan.algorithms.level.medium;
import com.freetymekiyan.algorithms.utils.Utils.ListNode;
/**
* You are given two non-empty linked lists representing two non-negative integers. The most significant digit comes
* first and each of their nodes contain a single digit. Add the two numbers and return ... | src/main/java/com/freetymekiyan/algorithms/level/medium/AddTwoNumbers2.java | 0.877975 | 0.620104 | AddTwoNumbers2.java | starcoder |
package us.ihmc.commonWalkingControlModules.momentumBasedController;
import java.util.ArrayList;
import java.util.List;
import gnu.trove.map.hash.TLongObjectHashMap;
import us.ihmc.robotics.nameBasedHashCode.NameBasedHashCodeTools;
import us.ihmc.robotics.referenceFrames.ReferenceFrame;
import us.ihmc.robotics.screwT... | CommonWalkingControlModules/src/us/ihmc/commonWalkingControlModules/momentumBasedController/GeometricJacobianHolder.java | 0.911984 | 0.57523 | GeometricJacobianHolder.java | starcoder |
package com.checkpoint.andela.notekeeper.activities;
import android.support.test.espresso.Espresso;
import android.support.test.espresso.matcher.ViewMatchers;
import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.LargeTest;
impo... | app/src/androidTest/java/com/checkpoint/andela/notekeeper/activities/CreateAndListNotesTest.java | 0.751922 | 0.431884 | CreateAndListNotesTest.java | starcoder |
import java.util.NoSuchElementException;
/**
* This is represents a rectangle class.
*/
public class Rectangle {
private int x;
private int y;
private int width;
private int height;
/**
* Constructs a Rectangle object and initialize it to the given x, y, width, and height.
* @param x th... | projects_in_java/CS5004/HW2_v14/src/Rectangle.java | 0.939415 | 0.478468 | Rectangle.java | starcoder |
package rocks.inspectit.server.dao;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import rocks.inspectit.shared.all.communication.DefaultData;
import rocks.inspectit.shared.all.communication.data.HttpTimerData;
import rocks.inspectit.shared.all.communication.data.JmxSensorValueData;
/**
... | inspectit.server/src/main/java/rocks/inspectit/server/dao/DefaultDataDao.java | 0.880976 | 0.517998 | DefaultDataDao.java | starcoder |
package fgd.optimization.linearp;
import fgd.optimization.linearp.model.SlackedLinearConstraint;
import fgd.optimization.linearp.model.Variable;
import fgd.optimization.linearp.model.lexical.LinearConstraint;
import fgd.optimization.linearp.model.lexical.ObjectiveFunction;
import fgd.optimization.linearp.model.lexical... | src/main/java/fgd/optimization/linearp/Simplex.java | 0.833053 | 0.40295 | Simplex.java | starcoder |
package com.itemanalysis.psychometrics.classicalitemanalysis;
import com.itemanalysis.psychometrics.data.VariableName;
import java.util.Formatter;
import java.util.Iterator;
/**
* Summarizes item responses that are numeric. Provides frequencies, proportions, mean, variance, and standard
* deviation for the entire ... | psychometrics-ctt/src/main/java/com/itemanalysis/psychometrics/classicalitemanalysis/NumericItemResponseSummary.java | 0.899166 | 0.544862 | NumericItemResponseSummary.java | starcoder |
package com.github.chen0040.leetcode.day02.easy;
/**
* Created by xschen on 28/7/2017.
*
* summary:
* You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water. Grid cells are connected horizontally/vertically (not diagonally). The grid is completely surrounded b... | src/main/java/com/github/chen0040/leetcode/day02/easy/IslandParameter.java | 0.922883 | 0.453867 | IslandParameter.java | starcoder |
package org.lcsim.detector;
import hep.physics.matrix.Matrix;
import hep.physics.matrix.MatrixOp;
import hep.physics.matrix.SymmetricMatrix;
import hep.physics.vec.BasicHep3Matrix;
import hep.physics.vec.BasicHep3Vector;
import hep.physics.vec.Hep3Matrix;
import hep.physics.vec.Hep3Vector;
import hep.physics.vec.VecOp... | detector-framework/src/main/java/org/lcsim/detector/Rotation3D.java | 0.923195 | 0.564849 | Rotation3D.java | starcoder |
package com.froobworld.viewdistancetweaks.util;
import java.util.ArrayList;
import java.util.List;
/**
* This is a tool for finding the total area of a set of integer rectangles where intersections are not double counted.
*/
public class RectangleUnionAreaFinder {
private final List<Rect> rectSet = new ArrayLis... | src/main/java/com/froobworld/viewdistancetweaks/util/RectangleUnionAreaFinder.java | 0.910681 | 0.566139 | RectangleUnionAreaFinder.java | starcoder |
package com.us.easylevel;
/**
* @author <NAME>
* <pre>
* ----------------------------------------------------------------------------------------------------
* You're given a two-dimensional array(a Matrix) of potentially unequal height and width containing
* only 1's and 0's. 1 represents land and 0 represent w... | DSProblems/src/com/us/easylevel/NoOfIsland.java | 0.820865 | 0.623348 | NoOfIsland.java | starcoder |
package org.pipecraft.infra.math;
/**
* Splits the UUID value range into K equal sized continuous shards, and returns the thresholds.
* Also allows determining the shard index given a UUID.
* The UUID space is assumed to have all letter case representations, but a single UUID is assumed to be consistent with regard... | pipes-core/src/main/java/org/pipecraft/infra/math/UUIDRangeSplitter.java | 0.911667 | 0.41947 | UUIDRangeSplitter.java | starcoder |
package javax.vecmath;
import java.io.Serializable;
public class GVector implements Serializable, Cloneable
{
private int length;
double[] values;
static final long serialVersionUID = 1398850036893875112L;
public GVector(final int length) {
this.length = length;
this.values = new... | javax/vecmath/GVector.java | 0.697197 | 0.59749 | GVector.java | starcoder |
package com.microsoft.sqlserver.jdbc;
import java.util.Set;
/**
* The ISQLServerBulkRecord interface can be used to create classes that read in data from any source (such as a file) and allow a SQLServerBulkCopy
* class to write the data to SQL Server tables.
*/
public interface ISQLServerBulkRecord {
/**
... | src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerBulkRecord.java | 0.877831 | 0.459379 | ISQLServerBulkRecord.java | starcoder |
import edu.princeton.cs.algs4.*;
public class Solver {
private static class SearchNode implements Comparable<SearchNode> {
final Board board;
final int moves;
final SearchNode previous;
SearchNode(Board board, int moves, SearchNode previous) {
this.board = board;
... | week4/solution4/Solver.java | 0.865153 | 0.418459 | Solver.java | starcoder |
package org.apache.servicemix.converter;
import java.util.HashMap;
import java.util.Map;
/**
* A set of helper methods and classes to convert a few basic types
* NOTE: if this grows any bigger, we might want to consider moving to Camel @Converter's for this
*/
public class Converters {
private Map<Class<?>, C... | src/main/java/org/apache/servicemix/converter/Converters.java | 0.846483 | 0.427516 | Converters.java | starcoder |
package com.aliasi.lm;
/**
* An <code>IntSeqCounter</code> provides counts for sequences of
* integers. This interface parallels {@link CharSeqCounter}.
*
* <P>The method {@link #count(int[],int,int)} returns the basic count
* for the specified integer sequence. The method {@link
* #extensionCount(int[],int,in... | aliasi-lingpipe/src/main/java/com/aliasi/lm/IntSeqCounter.java | 0.947551 | 0.526465 | IntSeqCounter.java | starcoder |
package math;
import java.nio.FloatBuffer;
import org.lwjgl.BufferUtils;
public class Vector3f
{
public static final int SIZE = 3;
public static final int BYTES = 3 * Float.BYTES;
public float x;
public float y;
public float z;
public Vector3f(float fill)
{
this.x = fill;
this.y = fill;
this.z = f... | VelvetEngine/src/math/Vector3f.java | 0.720958 | 0.51812 | Vector3f.java | starcoder |
package seedu.address.model.customGoal;
import java.time.LocalDate;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.util.Objects;
/**
* Represents a custom goal which is to be displayed on the dashboard.
*/
public class CustomGoal {
private static final String TIME_FORMAT = "... | src/main/java/seedu/address/model/customGoal/CustomGoal.java | 0.934058 | 0.509703 | CustomGoal.java | starcoder |
package jp.co.sony.csl.dcoes.apis.main.evaluation.scenario;
import io.vertx.core.AsyncResult;
import io.vertx.core.Handler;
import io.vertx.core.Vertx;
import io.vertx.core.json.JsonObject;
import java.util.List;
import jp.co.sony.csl.dcoes.apis.main.evaluation.scenario.impl.SimpleScenarioEvaluationImpl;
/**
* Ent... | src/main/java/jp/co/sony/csl/dcoes/apis/main/evaluation/scenario/ScenarioEvaluation.java | 0.692018 | 0.427576 | ScenarioEvaluation.java | starcoder |
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Scanner;
class Node {
public Integer label;
public ArrayList<Node> adjacencyList;
public Node(Integer label, ArrayList<Node> adjacencyList) {
this.label = label;
this.adjacencyList = adjac... | src/ComponentsInGraph.java | 0.629547 | 0.439988 | ComponentsInGraph.java | starcoder |
import java.util.*;
/**
* Created on: Feb 04, 2021
* Questions: https://www.algoexpert.io/questions/Rectangle%20Mania
*/
public class RectangleMania {
public static void main(String[] args) {
System.out.println(rectangleMania(buildPoint(new int[][]{{0, 0}, {0, 1}, {1, 0}, {2, 1}, {1, 3}, {3, 3}, {0, ... | AlgoExpert/RectangleMania.java | 0.837487 | 0.577644 | RectangleMania.java | starcoder |
package com.github.florent37.mylittlecanvas.animation;
import android.animation.ValueAnimator;
import com.github.florent37.mylittlecanvas.shape.TriangleShape;
public class TriangleShapeAnimation extends ShapeAnimation<TriangleShape> {
public TriangleShapeAnimation(TriangleShape shape) {
super(shape);
... | mylittlecanvas/src/main/java/com/github/florent37/mylittlecanvas/animation/TriangleShapeAnimation.java | 0.911409 | 0.400017 | TriangleShapeAnimation.java | starcoder |
package ubic.basecode.dataStructure.matrix;
import static org.junit.Assert.assertEquals;
import java.util.ArrayList;
import java.util.List;
import org.junit.Before;
import org.junit.Test;
public class DenseDouble3dMatrixTest {
double[][][] data3d = { { { 1, 2 }, { 3, 4 } }, { { 5, 6 }, { 7, 8 } } };
DoubleM... | test/ubic/basecode/dataStructure/matrix/DenseDouble3dMatrixTest.java | 0.819857 | 0.466056 | DenseDouble3dMatrixTest.java | starcoder |
package us.ihmc.atlas.calib;
import georegression.geometry.ConvertRotation3D_F64;
import georegression.struct.so.Rodrigues_F64;
import org.ejml.data.DenseMatrix64F;
import org.ejml.ops.CommonOps;
import us.ihmc.robotModels.FullRobotModel;
import us.ihmc.robotics.linearAlgebra.MatrixTools;
import us.ihmc.robotics.refer... | Atlas/src/us/ihmc/atlas/calib/CalibUtil.java | 0.853348 | 0.537102 | CalibUtil.java | starcoder |
package org.lwjgl.opengl;
import static org.lwjgl.system.Checks.*;
import static org.lwjgl.system.JNI.*;
/**
* Native bindings to the <a href="http://www.opengl.org/registry/specs/ARB/parallel_shader_compile.txt">ARB_parallel_shader_compile</a> extension.
*
* <p>Compiling GLSL into implementation-specific code ca... | 04lwjgl/code/lwjgl/org/lwjgl/opengl/ARBParallelShaderCompile.java | 0.820577 | 0.450662 | ARBParallelShaderCompile.java | starcoder |
package com.google.android.exoplayer.parser.webm;
import com.google.android.exoplayer.upstream.NonBlockingInputStream;
import java.nio.ByteBuffer;
/**
* Basic event-driven incremental EBML parser which needs an
* {@link EbmlEventHandler} to define IDs/types and react to events.
*
* <p>
* EBML can be summarized ... | src/com/google/android/exoplayer/parser/webm/EbmlReader.java | 0.921614 | 0.429968 | EbmlReader.java | starcoder |
package au.gov.aims.ereefs.bean.ncanimate;
import au.gov.aims.ereefs.database.manager.ncanimate.ConfigPartManager;
import au.gov.aims.json.JSONWrapperObject;
import org.json.JSONObject;
/**
* NcAnimate position bean part.
*
* <p>This NcAnimate configuration part is used in {@link NcAnimateLegendBean}
* and in {@l... | src/main/java/au/gov/aims/ereefs/bean/ncanimate/NcAnimatePositionBean.java | 0.898229 | 0.579638 | NcAnimatePositionBean.java | starcoder |
package pl.shockah.unicorn.algo.cluster;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import javax.annotation.Nonnull;
import java8.util.function.Function;
import java8.util.function.IntFunction;
import java8.util.stream.RefStreams;
import pl.shockah.unicorn.alg... | algorithm/src/pl/shockah/unicorn/algo/cluster/NearestNeighborKMeansClustering.java | 0.82011 | 0.617714 | NearestNeighborKMeansClustering.java | starcoder |
import java.util.Arrays;
public class NebulaDP {
public static int solution(boolean[][] g) {
int h = g.length;
int w = g[0].length;
// Solve using the following induction:
// State: number of columns left to build, the chosen state of the previous column in the previous step
... | NebulaDP.java | 0.587588 | 0.524029 | NebulaDP.java | starcoder |
package com.avail.utility.json;
import java.math.BigDecimal;
import java.math.BigInteger;
/**
* A {@code JSONNumber} is a JSON number. It provides convenience methods for
* extracting numeric values in different formats.
*
* @author <NAME> <<EMAIL>>
*/
public final class JSONNumber
extends JSONData
{
/** ... | src/main/java/com/avail/utility/json/JSONNumber.java | 0.956705 | 0.608769 | JSONNumber.java | starcoder |
package tr.com.infumia.infumialib.functions;
import lombok.AccessLevel;
import lombok.RequiredArgsConstructor;
import org.jetbrains.annotations.NotNull;
/**
* a class that represents unchecked multi optionals.
*
* @param <X> type of the left value.
* @param <Y> type of the right value.
*/
@RequiredArgsConstructo... | shared/src/main/java/tr/com/infumia/infumialib/functions/UncheckedMultiOptional.java | 0.885061 | 0.40157 | UncheckedMultiOptional.java | starcoder |
package eyesimo.processor.segmentators;
import java.util.Vector;
import eyesimo.util.AnalystColors;
public class EdgesFinder implements AnalystColors {
private int width;
private int height;
private int[] data;
private String colorName;
private int edgeColor;
private Vector<Edge> edges;
p... | platform/src/eyesimo/processor/segmentators/EdgesFinder.java | 0.602179 | 0.566618 | EdgesFinder.java | starcoder |
package stexfires.examples.util;
import stexfires.util.NumberCheckType;
import stexfires.util.NumberComparisonType;
import stexfires.util.supplier.RandomBooleanSupplier;
import stexfires.util.supplier.RepeatingPatternBooleanSupplier;
import stexfires.util.supplier.SwitchingBooleanSupplier;
import java.util.ArrayList;... | src/main/java/stexfires/examples/util/ExamplesBooleanSupplier.java | 0.76769 | 0.41834 | ExamplesBooleanSupplier.java | starcoder |
package com.addith.quantum;
/**
*
*
* The Interface QuantumRegisterInterface, represents the quantum register. The
* interface helps mock the register using mockito framework for tests
*
* Register interface is the "Receiver" interface for our command design
* pattern. It knows how to perform the operations ... | QuantumFactorizer/src/main/java/com/addith/quantum/QuantumRegisterInterface.java | 0.913607 | 0.594993 | QuantumRegisterInterface.java | starcoder |
package io.moatwel.crypto.eddsa;
import java.math.BigInteger;
/**
* A point on the eddsa curve which represents a group of {@link Coordinate}.
* <p>
* This point on the projective coordinate.
* A subclass of this class must be immutable object, in other words, all operations
* must create new object.
*
* @auth... | eddsa/src/main/java/io/moatwel/crypto/eddsa/Point.java | 0.975577 | 0.596727 | Point.java | starcoder |
package pl.tivian.security;
import java.nio.*;
import java.security.*;
import java.time.*;
import java.util.*;
import pl.tivian.util.*;
/**
* <p>This class implements Time-Based One-Time Password Algorithm as specified in
* <a href="https://tools.ietf.org/html/rfc6238" target="_blank">RFC 6238</a>,
* <a href=... | src/main/java/pl/tivian/security/AuthToken.java | 0.927827 | 0.629746 | AuthToken.java | starcoder |
package org.apache.geode.redis.internal.executor.string;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.exceptio... | geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/string/IncrIntegrationTest.java | 0.761095 | 0.585072 | IncrIntegrationTest.java | starcoder |
package com.jmex.effects;
import com.jme.math.Matrix4f;
import com.jme.math.Vector3f;
import com.jme.math.FastMath;
import com.jme.image.Texture;
import com.jme.util.geom.BufferUtils;
import java.nio.FloatBuffer;
import java.nio.IntBuffer;
import org.lwjgl.opengl.GL11;
import org.lwjgl.util.glu.GLU;
/**
* <code>Pr... | jme/src/main/java/com/jmex/effects/ProjectedTextureUtil.java | 0.744749 | 0.456652 | ProjectedTextureUtil.java | starcoder |
package com.tealorange.mancala.model;
import lombok.Data;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@Data
public class PlayerBoard {
private List<Pit> pits;
private MancalaPit mancalaPit;
private String id;
public PlayerBoa... | backend/src/main/java/com/tealorange/mancala/model/PlayerBoard.java | 0.720172 | 0.431584 | PlayerBoard.java | starcoder |
package local.sierraog.compflow.models;
public class Isentropic {
private double gamma;
private double mach;
private double machangle;
private double pmangle;
private double ppo;
private double rhorhoo;
private double tto;
private double ppstar;
private double rhorhostar;
... | src/main/java/local/sierraog/compflow/models/Isentropic.java | 0.720172 | 0.675502 | Isentropic.java | starcoder |
package com.yahoo.memory4;
import static com.yahoo.memory4.UnsafeUtil.assertBounds;
final class Util {
/**
* Searches a range of the specified array of longs for the specified value using the binary
* search algorithm. The range must be sorted method) prior to making this call.
* If it is not sorted, the ... | src/main/java/com/yahoo/memory4/Util.java | 0.902965 | 0.6137 | Util.java | starcoder |
Initial Thoughts:
We want to build a dense ranking array based on the scores as
we read them in
Using that and a few pointer variables we can iterate 1 time
over the scores array, advancing an unknown number of steps
for each score that Alice has. For each score Alice has we
will update our leaderboard index, which... | Algorithms/Implementation/Climbing the Leaderboard/Solution.java | 0.793786 | 0.527012 | Solution.java | starcoder |
package com.iankoulski.problems.ccibook.lists;
/*Partition
Write code to partition a linked list around a value x, such that all nodes less than x
come before all nodes greater than or equal to x. If x is contained within the list,
the values of x only need to be after the elements less than x.
The partition elemen... | Container-Root/problems/ccibook/02-linked-lists/src/main/java/com/iankoulski/problems/ccibook/lists/Partition.java | 0.793626 | 0.575111 | Partition.java | starcoder |
package com.github.bentorfs.ai.ml.reinforcement.qlearning.strategy;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import com.github.bentorfs.ai.common.FunctionLearner;
import com.github.bentorfs.ai.ml.reinforcement.qlearning.State;
/**
* This strategy will always select the next action... | src/main/java/com/github/bentorfs/ai/ml/reinforcement/qlearning/strategy/EpsilonGreedyStrategy.java | 0.918604 | 0.483466 | EpsilonGreedyStrategy.java | starcoder |
package dk.jonaslindstrom.math.algebra.algorithms;
import dk.jonaslindstrom.math.algebra.abstractions.Field;
import dk.jonaslindstrom.math.algebra.concretisations.ConstructiveReals;
import dk.jonaslindstrom.math.algebra.concretisations.FiniteField;
import dk.jonaslindstrom.math.algebra.concretisations.PrimeField;
impo... | src/main/java/dk/jonaslindstrom/math/algebra/algorithms/QuadraticEquation.java | 0.745306 | 0.451931 | QuadraticEquation.java | starcoder |
package de.longuyen.core.voronoi;
import de.longuyen.core.utils.Edge2D;
import de.longuyen.core.utils.EdgeDistancePack;
import de.longuyen.core.utils.Pair;
import de.longuyen.core.utils.Vector2D;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
public class TriangleCollection {
pri... | src/main/java/de/longuyen/core/voronoi/TriangleCollection.java | 0.940106 | 0.705975 | TriangleCollection.java | starcoder |
package org.firstinspires.ftc.teamcode.misc;
import static java.lang.Math.PI;
import static java.lang.Math.abs;
import static java.lang.Math.atan2;
import static java.lang.Math.cos;
import static java.lang.Math.sin;
import static java.lang.Math.toDegrees;
import androidx.annotation.NonNull;
import java.util.Locale;
... | TeamCode/src/main/java/org/firstinspires/ftc/teamcode/misc/Pose2D.java | 0.723016 | 0.583441 | Pose2D.java | starcoder |
package org.JMathStudio.MathToolkit.Numeric.Function1D;
import java.io.Serializable;
import org.JMathStudio.Exceptions.IllegalArgumentException;
/**
* This class define the Gaussian Function. A Gaussian Function is parametrised
* by its Mean and Standard deviation.
* <p>
* The default mean value is 0 and standar... | org/JMathStudio/MathToolkit/Numeric/Function1D/GaussianFunction1D.java | 0.920598 | 0.471649 | GaussianFunction1D.java | starcoder |
package Validator;
import Interfaces.SquareIF;
import Model.Board;
import Model.Piece;
import Model.Position;
import Enums.ChessPieceType;
import Enums.GameColor;
import Interfaces.BoardIF;
import Interfaces.PieceIF;
/**
* The Decorator abstract class for each movement type in Chess.
* @author <NAME> 100%
* @versi... | Validator/PieceValidator.java | 0.865948 | 0.429011 | PieceValidator.java | starcoder |
public class ValidBst {
public boolean isValidBST(TreeNode root) {
if(root == null) {
return true;
}
boolean leftll = true;
if(root.left != null) {
int leftMax = maxNode(root.left);
if(leftMax >= root.val) {
return false;
... | leetcode/src/main/java/ValidBst.java | 0.742982 | 0.481698 | ValidBst.java | starcoder |
package net.junyulong.ecc.core.widgets.eecInputViews;
public enum EecInputViewAlignBindType {
Top_to_Top_of,
Top_to_Bottom_of,
Bottom_to_Bottom_of,
Bottom_to_Top_of,
Left_to_Left_of,
Left_to_Right_of,
Right_to_Right_of,
Right_to_Left_of;
public final static String TtTo = "Top_to_T... | EEC Main/src/main/java/net/junyulong/ecc/core/widgets/eecInputViews/EecInputViewAlignBindType.java | 0.750553 | 0.484746 | EecInputViewAlignBindType.java | starcoder |
package com.rtg.util.array.byteindex;
import java.util.Arrays;
import com.rtg.util.array.ExtensibleIndex;
import com.rtg.util.integrity.Exam;
/**
* Break array into chunks to fit within java convention that indices must
* be ints.
*
*/
public final class ByteChunks extends ByteIndex implements ExtensibleIndex {
... | src/com/rtg/util/array/byteindex/ByteChunks.java | 0.890056 | 0.597843 | ByteChunks.java | starcoder |
package org.jacobvv.baserecycler;
import androidx.annotation.IntRange;
import androidx.annotation.NonNull;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
/**
* Created by Jacob on 18-4-3.
*/
public class BaseArrayAdapter<T> extends BaseRecyclerAdapter<T> {
private List<T> mDa... | baserecycler/src/main/java/org/jacobvv/baserecycler/BaseArrayAdapter.java | 0.884726 | 0.427695 | BaseArrayAdapter.java | starcoder |
package optimus.utils.datetime;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.temporal.JulianFields;
/**
* <p>
* DateTimeStorable provides static utility functions to convert {@link LocalDate}
* and {@link LocalDateTime} to binary format.
* </p><p>
* The binary format for LocalDat... | optimus/platform/projects/utils/src/main/scala/optimus/utils/datetime/DateTimeStorable.java | 0.890282 | 0.437583 | DateTimeStorable.java | starcoder |
package com.bysj.imageutil.util;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import com.bysj.imageutil.bean.SpliceBean;
import java.util.List;
/**
* 图片拼接工具类,该工具类只能拼接3*3(行列)下任意组合的图片,
* 且组合必须构成矩形,单行单列也算。
*
* Create on 2021-4-4
*/
public class ImageSpliceUtil {
public static Bitma... | app/src/main/java/com/bysj/imageutil/util/ImageSpliceUtil.java | 0.517815 | 0.504028 | ImageSpliceUtil.java | starcoder |
package com.raistone.wallet.sealwallet.daoutils;
import android.text.TextUtils;
import com.raistone.wallet.sealwallet.WalletApplication;
import com.raistone.wallet.sealwallet.factory.AssetsDeatilInfo;
import com.raistone.wallet.sealwallet.greendao.AssetsDeatilInfoDao;
import com.raistone.wallet.sealwallet.utils.BigDec... | Karathen-Android/app/src/main/java/com/raistone/wallet/sealwallet/daoutils/AssetsDetailDaoUtils.java | 0.506591 | 0.411702 | AssetsDetailDaoUtils.java | starcoder |
package com.etm.sdk.impl;
import org.testng.Assert;
import com.etm.sdk.EtmResult;
import com.etm.sdk.EtmSDK;
import com.etm.sdk.TestData;
import com.etm.sdk.dto.query.DelegateQueryParameters;
public class DelegateServiceTest {
@org.testng.annotations.Test
public void testGetCount() throws Exception {
... | test/com/etm/sdk/impl/DelegateServiceTest.java | 0.700997 | 0.452899 | DelegateServiceTest.java | starcoder |
package cesiumlanguagewriter;
import agi.foundation.compatibility.*;
import agi.foundation.compatibility.Func1;
import agi.foundation.compatibility.Lazy;
import cesiumlanguagewriter.advanced.*;
import java.util.List;
import javax.annotation.Nonnull;
/**
* Writes a {@code BoxDimensions} to a {@link CesiumOutputStrea... | Java/CesiumLanguageWriter/translatedSrc/cesiumlanguagewriter/BoxDimensionsCesiumWriter.java | 0.948716 | 0.471162 | BoxDimensionsCesiumWriter.java | starcoder |
package org.assertj.core.internal;
import static org.assertj.core.error.future.ShouldBeCancelled.shouldBeCancelled;
import static org.assertj.core.error.future.ShouldBeDone.shouldBeDone;
import static org.assertj.core.error.future.ShouldNotBeCancelled.shouldNotBeCancelled;
import static org.assertj.core.error.future.S... | src/main/java/org/assertj/core/internal/Futures.java | 0.866302 | 0.552902 | Futures.java | starcoder |
package org.gradoop.examples.aggregation;
import org.apache.flink.api.java.ExecutionEnvironment;
import org.gradoop.examples.common.TemporalCitiBikeGraph;
import org.gradoop.examples.common.functions.TransformLongPropertiesToDateTime;
import org.gradoop.flink.util.GradoopFlinkConfig;
import org.gradoop.temporal.model.... | gradoop-examples/gradoop-examples-temporal/src/main/java/org/gradoop/examples/aggregation/TemporalAggregationExample.java | 0.90083 | 0.407363 | TemporalAggregationExample.java | starcoder |
package com.jayfella.easing;
public class Easings {
public enum Function {
Back,
Bounce,
Circ,
Cubic,
Elastic,
Expo,
Linear,
Quad,
Quart,
Quint,
Sine;
/**
* Ease IN
* @param t Time: The duration of t... | src/main/java/com/jayfella/easing/Easings.java | 0.947938 | 0.592784 | Easings.java | starcoder |
package com.moparisthebest.poi.hssf.record;
import com.moparisthebest.poi.util.HexDump;
/**
* Base class for all old (Biff 2 - Biff 4) cell value records
* (implementors of {@link CellValueRecordInterface}).
* Subclasses are expected to manage the cell data values (of various types).
*/
public abstract class Ol... | src/main/java/com/moparisthebest/poi/hssf/record/OldCellRecord.java | 0.807916 | 0.485051 | OldCellRecord.java | starcoder |
package com.duprasville.limiters.util.karytree;
/*
* Models a K-ary tree of H height with a perfect-tree capacity of N nodes, where
* - each node is identified by n = 0..N-1
* - the root of the tree is a single node n = 0
* - nodes have K children c[0..K-1]
* - nodes are numbered breadth-first
* - each... | src/main/java/com/duprasville/limiters/util/karytree/KaryTree.java | 0.836254 | 0.546436 | KaryTree.java | starcoder |
package au.edu.federation.caliko;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import au.edu.federation.caliko.FabrikChain2D.BaseboneConstraintType2D;
import au.edu.federation.caliko.FabrikJoint2D.ConstraintCoordinateSystem;
import au.edu.federation.utils.Colour4f;
import au.edu.fe... | src/main/kotlin/au/edu/federation/caliko/FabrikChain2D.java | 0.847385 | 0.640284 | FabrikChain2D.java | starcoder |
package seedu.jarvis.logic.commands;
import static java.util.Objects.requireNonNull;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Deque;
import java.util.List;
import seedu.jarvis.logic.commands.exceptions.CommandNotFoundException;
/**
* A deque of commands that does not allow nulls.
... | src/main/java/seedu/jarvis/logic/commands/CommandDeque.java | 0.932883 | 0.570331 | CommandDeque.java | starcoder |
package Players.Engines;
import java.util.ArrayList;
import java.util.Random;
import java.util.Stack;
public class IntermediateAdversary extends NaiveSolver {
private boolean IS_TARGETING;
private ArrayList<Integer> targets;
private ArrayList<Integer> hunts;
private Stack<Integer> targetsFired;
pr... | Players/Engines/IntermediateAdversary.java | 0.890812 | 0.453504 | IntermediateAdversary.java | starcoder |
package org.researchstack.backbone.task;
import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Parcel;
import org.researchstack.backbone.R;
import org.researchstack.backbone.result.TaskResult;
import org.researchstack.backbone.step.Step;
import org.researchstack.backbone.utils.Text... | backbone/src/main/java/org/researchstack/backbone/task/OrderedTask.java | 0.906744 | 0.492554 | OrderedTask.java | starcoder |
package org.jfugue.pattern;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
public class PatternTest {
@Test
public void testSetTempo1() {
Pattern pattern = new Pattern("A B C");
pattern.setTempo("Adagio");
assertTrue(pattern.toString().equals("T60 A B C"));
... | test/java/org/jfugue/pattern/PatternTest.java | 0.791982 | 0.726874 | PatternTest.java | starcoder |
package com.lmax.disruptor;
/**
* Coordinates claiming sequences for access to a data structure while tracking dependent {@link Sequence}s
*
*/
public interface Sequencer extends Cursored, Sequenced
{
/**
* Set to -1 as sequence starting point
*/
long INITIAL_CURSOR_VALUE = -1L;
/**
* Cl... | src/main/java/com/lmax/disruptor/Sequencer.java | 0.932997 | 0.439507 | Sequencer.java | starcoder |
package org.apache.commons.validator.routines;
import java.io.Serializable;
import org.apache.commons.validator.routines.checkdigit.CheckDigit;
/**
* Generic <b>Code Validation</b> providing format, minimum/maximum
* length and {@link CheckDigit} validations.
* <p>
* Performs the following validations on a code:... | Walk_in_Clinic/app/commons-validator-1.6-src/src/main/java/org/apache/commons/validator/routines/CodeValidator.java | 0.967564 | 0.575707 | CodeValidator.java | starcoder |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.