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 |
|---|---|---|---|---|---|
import java.util.stream.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Arrays;
import java.lang.StringBuilder;
/*
variables: number of digits, the nth permutation
Description:
Fixes one of the (n) digits and finds the number of permutations with the
remaining digits.
... | problem_24.java | 0.659405 | 0.437703 | problem_24.java | starcoder |
package com.rometools.modules.georss.geometries;
/**
* Envelope, a bounding box spanned by an upper right and lower left corner point. Note that if the
* box spans the -180 180 degree meridian the numerical value of the minLongitude may be greater
* than the maxLongitude.
*
* @author runaas
*/
public class Envel... | src/main/java/com/rometools/modules/georss/geometries/Envelope.java | 0.964187 | 0.562898 | Envelope.java | starcoder |
package clockharness.util;
import static java.lang.Math.*;
public class Easing {
/**
* Simple linear tweening - No easing
*
* @param t current time wrt duration
* @param b start value
* @param c change in value
* @param d duration wrt current time
* @return the "eased" value
... | clockharness/src/clockharness/util/Easing.java | 0.95156 | 0.58673 | Easing.java | starcoder |
package shane.nolan.wit.utils;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
public class MultiDimensionalPointUtils {
/**
* Given a list of nodes with n dimensions
* Find t... | src/main/java/shane/nolan/wit/utils/MultiDimensionalPointUtils.java | 0.825871 | 0.653949 | MultiDimensionalPointUtils.java | starcoder |
package com.reason.lang.rescript;
import com.intellij.psi.*;
import com.reason.lang.core.psi.impl.PsiIfStatement;
import com.reason.lang.core.psi.impl.*;
import com.reason.lang.reason.*;
@SuppressWarnings("ConstantConditions")
public class IfParsingTest extends ResParsingTestCase {
public void test_basic_if() {
... | tests/com/reason/lang/rescript/IfParsingTest.java | 0.774882 | 0.486636 | IfParsingTest.java | starcoder |
package leet_hw1;
import java.util.*;
/**
* 210. Course Schedule II
Total Accepted: 60431
Total Submissions: 221839
Difficulty: Medium
Contributor: LeetCode
There are a total of n courses you have to take, labeled from 0 to n - 1.
Some courses may have prerequisites, for example to take course 0 you have to first t... | hw5/hw5_CourseSchedule2.java | 0.685423 | 0.657532 | hw5_CourseSchedule2.java | starcoder |
package com.opengamma.analytics.financial.model.finitedifference.applications;
import java.util.Arrays;
import com.opengamma.analytics.financial.model.finitedifference.BoundaryCondition;
import com.opengamma.analytics.financial.model.finitedifference.ConvectionDiffusionPDE1DCoefficients;
import com.opengamma.analytic... | projects/analytics/src/main/java/com/opengamma/analytics/financial/model/finitedifference/applications/LocalVolPDEPricer.java | 0.785309 | 0.679179 | LocalVolPDEPricer.java | starcoder |
package io.jbaker.strassen;
import java.util.Arrays;
import com.google.common.base.Preconditions;
public class Strassen {
private static boolean isPow2(long n) {
// max value of long 2^63-1, so max power of 2 2^62.
for (int i = 0; i < 63; i++) {
if (n == (1 << i)) {
return true;
}
}
return false... | src/main/java/io/jbaker/strassen/Strassen.java | 0.501465 | 0.438364 | Strassen.java | starcoder |
package robocode.naval.interfaces;
import robocode.HitRobotEvent;
import robocode.HitWallEvent;
import robocode.robotinterfaces.IBasicRobot;
import java.awt.*;
/**
* @author <NAME>. / <NAME>
* @since 1.8.3 Alpha 1
* @version 0.1
*/
public interface IShip extends IBasicRobot{
/**
* Sets the course towards... | robocode.api/src/main/java/robocode/naval/interfaces/IShip.java | 0.882136 | 0.565539 | IShip.java | starcoder |
package android.animation;
/**
* Abstract base class used convert type T to another type V and back again. This
* is necessary when the value types of in animation are different from the property
* type. BidirectionalTypeConverter is needed when only the final value for the
* animation is supplied to animators.
*... | core/java/android/animation/BidirectionalTypeConverter.java | 0.908025 | 0.414366 | BidirectionalTypeConverter.java | starcoder |
package org.cesiumjs.cs.core;
import jsinterop.annotations.JsConstructor;
import jsinterop.annotations.JsProperty;
import jsinterop.annotations.JsType;
import org.cesiumjs.cs.core.enums.Intersect;
/**
* The culling volume defined by planes.
*
* @author <NAME> aka iSergio
*/
@JsType(isNative = true, namespace = "C... | cesiumjs4gwt-main/src/main/java/org/cesiumjs/cs/core/CullingVolume.java | 0.894046 | 0.419826 | CullingVolume.java | starcoder |
package pl.prv.techalive.encoder.hashes;
import java.util.ArrayList;
import java.util.List;
import pl.prv.techalive.encoder.utils.ArrayUtils;
/**
* The MD5 Message-Digest Algorithm
*/
class MD5 {
/**
* MD Buffer
*/
private int A;
private int B;
private int C;
private int D;
/**
... | java/pl/prv/techalive/encoder/hashes/MD5.java | 0.81309 | 0.517876 | MD5.java | starcoder |
package com.nts.cleancode.collections;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import org.junit.Before;
import org.junit.Test;
import com.nts.cleancode.collections.List;
import com.nts.cleancode.collections.Set;
public class ListTe... | test/com/nts/cleancode/collections/ListTest.java | 0.817829 | 0.519278 | ListTest.java | starcoder |
package com.autonomy.nonaci.indexing.impl;
/**
* Allows you to identify individual documents and/or document ranges by their references or IDs (note that ranges can
* only be identified using IDs), and change the value of their importance rating, database, index date, and expire
* date.
*
* @author boba
*/
publi... | src/main/java/com/autonomy/nonaci/indexing/impl/DreChangeMetaCommand.java | 0.889394 | 0.519034 | DreChangeMetaCommand.java | starcoder |
package me.itsrishi.exercisecounter;
import android.support.test.espresso.Espresso;
import android.support.test.espresso.action.ViewActions;
import android.support.test.espresso.assertion.ViewAssertions;
import android.support.test.espresso.contrib.RecyclerViewActions;
import android.support.test.rule.ActivityTestRule... | app/src/androidTest/java/me/itsrishi/exercisecounter/SessionInstrumentedTest.java | 0.642096 | 0.403097 | SessionInstrumentedTest.java | starcoder |
import java.util.ArrayList;
/**
* Recursion and Lambda Expressions
* @author <NAME>
*/
public class Recursion {
public static void main(String[] args) {
/*
* Recursion is a functional programming technique in which a function (or method) will call itself
* repeatedly until a base case is reached.
*
... | Java Review/Learn Java Programming/Recursion.java | 0.507568 | 0.583648 | Recursion.java | starcoder |
package patternmatch.patternmatch;
import java.util.Optional;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Supplier;
public class PatternMatch {
public static <T, V1 extends T, R> R match(final T t, final Case<V1, R> c1, final Default<R> defaultF) {
ret... | src/patternmatch/patternmatch/PatternMatch.java | 0.779448 | 0.599221 | PatternMatch.java | starcoder |
package com.zerowater.environment.util;
import android.content.res.Resources;
import android.util.DisplayMetrics;
public final class DisplayMetricsUtil {
/**
* Convert pixels to DP using the device screen density
*/
public static float pxToDp(float px) {
float densityDpi = Resources.getSys... | app/src/main/java/com/zerowater/environment/util/DisplayMetricsUtil.java | 0.945033 | 0.515681 | DisplayMetricsUtil.java | starcoder |
* @test
* @bug 8241798
* @summary test an enum that is close to the maximum size
*/
public enum BigEnum {
C0001, C0002, C0003, C0004, C0005, C0006, C0007, C0008, C0009, C0010,
C0011, C0012, C0013, C0014, C0015, C0016, C0017, C0018, C0019, C0020,
C0021, C0022, C0023, C0024, C0025, C0026, C0027, C0028, C0029, ... | test/langtools/tools/javac/enum/BigEnum.java | 0.519521 | 0.622703 | BigEnum.java | starcoder |
import grid.logic.LogicStatus;
import grid.puzzlebits.Path.Path;
import org.omg.CORBA.UNKNOWN;
import java.awt.Point;
import java.util.Iterator;
public class NumberedGatePathLogicStep implements grid.logic.LogicStep<Board> {
private static enum OpDir { UNKNOWN, INCREMENTING, DECREMENTING };
private static c... | ada05/src/NumberedGatePathLogicStep.java | 0.62498 | 0.417568 | NumberedGatePathLogicStep.java | starcoder |
package com.bfr.util.math;
import com.bfr.control.path.Position;
import org.firstinspires.ftc.robotcore.internal.android.dx.util.Warning;
/**
* Line in standard form to be compatible with basic matrix operations.
* Represents a line in 2d space without falling into the trap of functionality, slope, etc.
* @author... | TeamCode/src/main/java/com/bfr/util/math/Line.java | 0.826502 | 0.555556 | Line.java | starcoder |
package com.intellij.lang.jsgraphql.types.schema;
import com.intellij.lang.jsgraphql.types.PublicSpi;
import java.util.Map;
/**
* The Coercing interface is used by {@link com.intellij.lang.jsgraphql.types.schema.GraphQLScalarType}s to parse and serialise object values.
* <p>
* There are two major responsibilitie... | src/main/com/intellij/lang/jsgraphql/types/schema/Coercing.java | 0.949972 | 0.400105 | Coercing.java | starcoder |
package umontreal.ssj.randvar;
import umontreal.ssj.rng.*;
import umontreal.ssj.probdist.BetaSymmetricalDist;
/**
* This class implements *symmetrical beta* random variate generators using
* Devroye’s one-liner method. It is based on Best’s relation
* @cite rBES78a  between a Student-@f$t@f$ variate and a sy... | src/main/java/umontreal/ssj/randvar/BetaSymmetricalBestGen.java | 0.859443 | 0.487063 | BetaSymmetricalBestGen.java | starcoder |
package com.opengamma.web.analytics;
import com.opengamma.util.ArgumentChecker;
/**
* Represents a cell in a grid displaying analytics data. This class is also useful for specifying cell co-ordinates as
* parameters to JAX-RS HTTP methods. The JAX-RS container can automatically create objects from form parameters i... | projects/OG-Web/src/main/java/com/opengamma/web/analytics/GridCell.java | 0.938976 | 0.439386 | GridCell.java | starcoder |
package co.edu.uniandes.csw.paseos.dtos;
import co.edu.uniandes.csw.paseos.entities.CalificacionEntity;
import co.edu.uniandes.csw.paseos.entities.CaminanteEntity;
import co.edu.uniandes.csw.paseos.entities.InscripcionEntity;
import co.edu.uniandes.csw.paseos.entities.OpinionParticipanteEntity;
import java.util.ArrayL... | paseos-02-web/src/main/java/co/edu/uniandes/csw/paseos/dtos/CaminanteDetailDTO.java | 0.649134 | 0.403596 | CaminanteDetailDTO.java | starcoder |
package mitiv.utils;
public class Poly {
/**
* Compute the roots of a 2nd degree polynomial.
*
* <p> Solve the quadratic equation: </p>
*
* <pre>
* a*x^2 + b*x + c = 0
* </pre>
*
* <p> for real {@code x}. The number {@code n} of distinct real roots is
* returned an... | src/mitiv/utils/Poly.java | 0.815233 | 0.784938 | Poly.java | starcoder |
package net.ibbaa.keepitup.ui;
import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu;
import static androidx.test.espresso.action.ViewActions.click;
import static androidx.test.espresso.action.ViewActions.longClick;
import static androidx... | keepitupmain/src/androidTest/java/net/ibbaa/keepitup/ui/GlobalSettingsActivityTest.java | 0.607314 | 0.457016 | GlobalSettingsActivityTest.java | starcoder |
package org.nschmidt.ldparteditor.data;
import java.math.BigDecimal;
import java.util.HashMap;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL20;
import org.lwjgl.util.vector.Matrix4f;
import org.lwjgl.util.vector.Vector3f;
import org.lwjgl.util.vector.Vector4f;
import org.nschmidt.ldparteditor.composites.Co... | src/org/nschmidt/ldparteditor/data/GData5.java | 0.735926 | 0.571767 | GData5.java | starcoder |
package edu.uci.ics.jung.visualization.transform.shape;
import edu.uci.ics.jung.layout.model.Point;
import edu.uci.ics.jung.layout.model.PolarPoint;
import edu.uci.ics.jung.visualization.transform.HyperbolicTransformer;
import edu.uci.ics.jung.visualization.transform.Lens;
import edu.uci.ics.jung.visualization.transfo... | jung-visualization/src/main/java/edu/uci/ics/jung/visualization/transform/shape/HyperbolicShapeTransformer.java | 0.935685 | 0.438124 | HyperbolicShapeTransformer.java | starcoder |
package model;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* This Visitor has two parameters: language and paymentType.
* When visiting a Folder it scans the folder for all bookings that have the specified language and paymentType.
* The found Bookings are being stored in the booki... | Statistics/src/model/BookingStatisticVisitor.java | 0.842637 | 0.409634 | BookingStatisticVisitor.java | starcoder |
package gov.usgs.processingformats;
import java.util.*;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
/**
* a conversion class used to create, parse, and validate location processing data
*
* @author U.S. Geological Survey <jpatton at usgs.gov>
*/
public class LocationResult implement... | java/src/main/java/gov/usgs/processingformats/LocationResult.java | 0.90703 | 0.400925 | LocationResult.java | starcoder |
package com.telenav.osv.recorder.camera.util;
import androidx.annotation.NonNull;
import com.telenav.osv.utils.Size;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
/**
* Class for describing proportional relationship between width and height.
*/
public class As... | app/src/main/java/com/telenav/osv/recorder/camera/util/AspectRatio.java | 0.957902 | 0.440469 | AspectRatio.java | starcoder |
package com.github.dawidkski.scanner.camera.frame;
import android.media.Image;
import org.opencv.core.CvType;
import org.opencv.core.Mat;
import org.opencv.imgproc.Imgproc;
import java.nio.ByteBuffer;
public class RGBACameraFrame implements CameraFrame {
private final Image mImage;
private Mat mFrame;
... | scanner-app/src/main/java/com/github/dawidkski/scanner/camera/frame/RGBACameraFrame.java | 0.858837 | 0.407392 | RGBACameraFrame.java | starcoder |
package util;
public class Vector2D {
public static final Vector2D ZERO = new Vector2D(0, 0);
private final double x;
private final double y;
public Vector2D(double x, double y) {
this.x = x;
this.y = y;
}
public Vector2D copy() {
return new Vector2D(x, y... | src/util/Vector2D.java | 0.936336 | 0.76869 | Vector2D.java | starcoder |
package com.tranxactive.j2pay.gateways.parameters;
/**
*
* @author ilyas
*/
public enum Country {
AF("AF", "AFG", "Afghanistan", "004"),
AX("AX", "ALA", "Åland Islands", "248"),
AL("AL", "ALB", "Albania", "008"),
DZ("DZ", "DZA", "Algeria", "012"),
AS("AS", "ASM", "American Samoa", "016"),
A... | src/main/java/com/tranxactive/j2pay/gateways/parameters/Country.java | 0.587115 | 0.431584 | Country.java | starcoder |
package sc.fiji.pQCT.io;
import java.util.Arrays;
import java.util.stream.IntStream;
public class ScaledImageData {
public final double[] scaledImage;
public final double[] softScaledImage;
public final double minimum;
public final int width;
public final int height;
public final double pixelSpacing;
// Cons... | src/main/java/sc/fiji/pQCT/io/ScaledImageData.java | 0.708414 | 0.446072 | ScaledImageData.java | starcoder |
package com.android.contacts.model;
import android.os.Bundle;
import android.test.AndroidTestCase;
import android.test.MoreAsserts;
import android.test.suitebuilder.annotation.SmallTest;
import com.android.contacts.model.account.AccountWithDataSet;
import com.google.common.collect.Lists;
import java.util.List;
/**... | tests/src/com/android/contacts/model/AccountWithDataSetTest.java | 0.77535 | 0.586286 | AccountWithDataSetTest.java | starcoder |
package com.mortennobel.imagescaling.experimental;
import com.mortennobel.imagescaling.DimensionConstrain;
import com.mortennobel.imagescaling.AdvancedResizeOp;
import java.awt.*;
import java.awt.image.BufferedImage;
/**
* The idea of this class is to test if the Sun's implementation multistep image scaling (using ... | src/main/java/com/mortennobel/imagescaling/experimental/ImprovedMultistepRescaleOp.java | 0.608594 | 0.434641 | ImprovedMultistepRescaleOp.java | starcoder |
package za.sabob.olive;
import java.util.*;
/**
* Provides the different modes to run an {@link Olive} instance with.
* <p/>
* In {@link #PRODUCTION} mode SQL files and parsed SQL strings will be cached for fast retrieval.
* <p/>
* * In {@link #DEVELOPMENT} mode SQL files will <em>not</em> be cached and can be d... | src/main/java/za/sabob/olive/Mode.java | 0.868241 | 0.409634 | Mode.java | starcoder |
package edu.wsu.eecs.gfc.core;
import java.util.*;
import java.util.stream.Collectors;
/**
* The major GFC mining algorithms.
* <p>
* @author <NAME> <EMAIL>
*/
public class RuleMiner<VT, ET> {
private GraphDatabase<VT, ET> G;
private double minSupp;
private double minConf;
private int maxSize;... | SourceCode-GFC/src/main/java/edu/wsu/eecs/gfc/core/RuleMiner.java | 0.852614 | 0.496094 | RuleMiner.java | starcoder |
package com.solution.onequestionperday.may2021.leafsimilartrees872;
import java.util.ArrayList;
import java.util.List;
/**
* @ClassName LeafSimilarTrees
* @Description 872. Leaf-Similar Trees
* Consider all the leaves of a binary tree, from left to right order, the values of those leaves form a leaf value sequence... | src/com/solution/onequestionperday/may2021/leafsimilartrees872/LeafSimilarTrees.java | 0.854627 | 0.561996 | LeafSimilarTrees.java | starcoder |
package io.github.mariazevedo88.hc.prepkit.graphs;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Consider a matrix where each cell contains either a 0 or a 1 and any cell containing a 1 is
* called a filled cell. Two cells are said to be connected if they are adjacent to each other
* horizontall... | src/main/java/io/github/mariazevedo88/hc/prepkit/graphs/DFSConnectedCellGrid.java | 0.717705 | 0.697158 | DFSConnectedCellGrid.java | starcoder |
package org.openmrs.customdatatype;
/**
* Represents a custom datatype, which an administrator may use for global properties, attribute types, etc.
* Handles conversion between a typed Java object and a reference string which can be persisted in a database
* varchar column.
* @param <T> the Java class used for ty... | evaluation/themis_openmrs-core_unsafe/src/main/java/org/openmrs/customdatatype/CustomDatatype.java | 0.911439 | 0.528168 | CustomDatatype.java | starcoder |
package artisynth.tools.batchsim.manager;
import java.util.NoSuchElementException;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import artisynth.tools.batchsim.manager.DistributionSampler.Distribution;
import static artisynth.tools.batchsim.manager.PropertySpecification.SpecificationT... | src/artisynth/tools/batchsim/manager/PropertySpecification.java | 0.922601 | 0.487551 | PropertySpecification.java | starcoder |
package io.octoprime.ps.fb.easy;
import java.util.Arrays;
import java.util.Vector;
public class MoveZeros {
/**
* space complexity: O(n)
* time complexity: O(n); however it is sub optimal due to additional steps required.
* sub-optimal
*
* @param nums
* @return
*/
private st... | src/main/java/io/octoprime/ps/fb/easy/MoveZeros.java | 0.848722 | 0.515681 | MoveZeros.java | starcoder |
package de.adorsys.common.utils;
/**
* Created by peter on 03.01.18.
*/
public class HexUtil {
private static final int SEG_SIZE = 16;
private static final char[] hexDigits = {
'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
};
private HexU... | src/main/java/de/adorsys/common/utils/HexUtil.java | 0.754644 | 0.434761 | HexUtil.java | starcoder |
package smile.sequence;
import java.util.Arrays;
import java.util.function.ToIntFunction;
/**
* First-order Hidden Markov Model sequence labeler.
*
* @author <NAME>
*/
public class HMMLabeler<T> implements SequenceLabeler<T> {
private static final long serialVersionUID = 2L;
/** The HMM model. */
pub... | core/src/main/java/smile/sequence/HMMLabeler.java | 0.970813 | 0.754621 | HMMLabeler.java | starcoder |
package org.sosy_lab.cpachecker.cpa.smg.graphs.value;
import static com.google.common.base.Preconditions.checkNotNull;
import java.math.BigInteger;
import org.sosy_lab.cpachecker.cpa.smg.graphs.edge.SMGEdgePointsTo;
import org.sosy_lab.cpachecker.cpa.smg.graphs.object.SMGNullObject;
import org.sosy_lab.cpachecker.cp... | src/org/sosy_lab/cpachecker/cpa/smg/graphs/value/SMGKnownAddressValue.java | 0.632389 | 0.425546 | SMGKnownAddressValue.java | starcoder |
package boofcv.abst.sfm.d3;
import boofcv.abst.sfm.AccessPointTracks3D;
import boofcv.abst.tracker.PointTrack;
import boofcv.alg.feature.associate.AssociateStereo2D;
import boofcv.alg.geo.DistanceFromModelMultiView;
import boofcv.alg.geo.pose.PnPStereoDistanceReprojectionSq;
import boofcv.alg.geo.pose.PnPStereoEstimat... | main/boofcv-sfm/src/main/java/boofcv/abst/sfm/d3/WrapVisOdomDualTrackPnP.java | 0.660172 | 0.480113 | WrapVisOdomDualTrackPnP.java | starcoder |
package fundamentals.graph.bfs.toposort.lc210_courseschedule2;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Queue;
/**
* There are a total of n courses you have to take, labeled from 0 to n - 1.
* Some courses may have prerequisites, for example to take course 0 y... | 1-algorithm/13-leetcode/java/src/fundamentals/graph/bfs/toposort/lc210_courseschedule2/Solution.java | 0.857246 | 0.568595 | Solution.java | starcoder |
package org.apache.commons.math3.fitting;
import org.apache.commons.math3.analysis.polynomials.PolynomialFunction;
import org.apache.commons.math3.optim.nonlinear.vector.MultivariateVectorOptimizer;
/**
* Polynomial fitting is a very simple case of {@link CurveFitter curve fitting}.
* The estimated coefficients are... | src/org/apache/commons/math3/fitting/PolynomialFitter.java | 0.962179 | 0.726838 | PolynomialFitter.java | starcoder |
package bookflight.booking.objects;
import bookflight.booking.SeatClass;
import bookflight.booking.SeatType;
import bookflight.booking.exceptions.SeatTakenException;
/**
* This is the airplane that users can book seats on
* @author <NAME>
*/
public class Airplane {
/**
* Automatically create this plane w... | BookFlight/src/bookflight/booking/objects/Airplane.java | 0.733929 | 0.509581 | Airplane.java | starcoder |
package finalproject.Math;
/**
* Manages culling.
*
*/
public class CullInformation
{
public float[] modelView = null;
public float[] neaClip = null;
public float[] farClip = null;
public float[] lftClip = null;
public float[] rgtClip = null;
public float[] botClip = null;
public float[] topCl... | app/src/main/java/KobolAdventures/app/finalproject/Math/CullInformation.java | 0.73431 | 0.4856 | CullInformation.java | starcoder |
package frc.team7170.lib;
import java.util.Objects;
import java.util.logging.Logger;
import java.util.regex.Pattern;
/**
* A container for a single {@link String String} that represents a name. Additionally, {@code Name} exposes some static
* methods for checking the validity of names in the form of {@code String S... | src/main/java/frc/team7170/lib/Name.java | 0.856392 | 0.474205 | Name.java | starcoder |
package entities.trees;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Deque;
import java.util.List;
import entities.Tuple;
/**
* A prefix representation of T-DP solutions that allows for sharing common prefixes.
* The prefix is with respect to a stage ord... | src/main/java/entities/trees/TDP_Prefix_Solution.java | 0.894189 | 0.523664 | TDP_Prefix_Solution.java | starcoder |
package io.basestar.storage.sql.mapper;
import io.basestar.schema.InstanceSchema;
import io.basestar.schema.Reserved;
import io.basestar.storage.sql.mapper.column.ColumnMapper;
import io.basestar.util.Name;
import org.jooq.*;
import org.jooq.impl.DSL;
import java.util.*;
import java.util.stream.Collectors;
public in... | basestar-storage-sql/src/main/java/io/basestar/storage/sql/mapper/RowMapper.java | 0.835685 | 0.406921 | RowMapper.java | starcoder |
package virtual_robot.controller;
import javafx.geometry.Bounds;
import javafx.scene.Group;
import javafx.scene.layout.StackPane;
import javafx.scene.transform.Translate;
import virtual_robot.util.Vector2D;
/**
* For internal use only. Abstract base class for game element configurations.
*
* A game element class... | Controller/src/virtual_robot/controller/VirtualGameElement.java | 0.718199 | 0.402656 | VirtualGameElement.java | starcoder |
package com.radixdlt.examples.tictactoe;
import java.util.Objects;
/**
* An immutable pair of elements.
* <p>
* Note that in reality, as for all containers,
* instances of this class are only immutable
* if their contained objects are also immutable.
* @param <F> Type of the first element
* @param <S> Type of ... | radixdlt-engine/examples/src/main/java/com/radixdlt/examples/tictactoe/Pair.java | 0.938393 | 0.530419 | Pair.java | starcoder |
package org.archive.util.ms;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.archive.io.BufferedSeekInputStream;
import org.archive.io.Endian;
import org.archive.io.OriginSeekInputStream;
import org.archive.io.SafeSeekInputStream;
import org.archive.io.SeekInput... | commons/src/main/java/org/archive/util/ms/PieceTable.java | 0.801509 | 0.466481 | PieceTable.java | starcoder |
*/
package com.github.quikmod.quikcore.util;
import java.lang.reflect.Array;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Deque;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;
impo... | src/main/java/com/github/quikmod/quikcore/util/TypeHelper.java | 0.93835 | 0.624322 | TypeHelper.java | starcoder |
package com.opengamma.masterdb.security;
import java.util.EnumMap;
import com.opengamma.master.security.ManageableSecurity;
import com.opengamma.master.security.SecurityDocument;
import com.opengamma.master.security.SecurityHistoryRequest;
import com.opengamma.master.security.SecurityHistoryResult;
import com.opengam... | projects/OG-MasterDB/src/main/java/com/opengamma/masterdb/security/DbSecurityBeanMaster.java | 0.846229 | 0.451085 | DbSecurityBeanMaster.java | starcoder |
package ru.tinkoff.objects;
/*
* @author <NAME>
*/
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
public class DiffElement {
private List<String> diff;
private String name;
private String display;
private String image;
private Result text;
private HashMap<Stri... | utils/src/main/java/ru/tinkoff/objects/DiffElement.java | 0.852721 | 0.453806 | DiffElement.java | starcoder |
package com.tom.cpl.math;
public class Mat3f {
protected float m00;
protected float m01;
protected float m02;
protected float m10;
protected float m11;
protected float m12;
protected float m20;
protected float m21;
protected float m22;
public Mat3f() {
}
public Mat3f(Quaternion quaternionIn) {
float f ... | CustomPlayerModels/src/shared/java/com/tom/cpl/math/Mat3f.java | 0.682468 | 0.49939 | Mat3f.java | starcoder |
package rasterizer.util;
import com.jogamp.opengl.GL3;
import com.jogamp.opengl.GLCapabilities;
import com.jogamp.opengl.GLProfile;
import com.jogamp.opengl.awt.GLCanvas;
import java.nio.FloatBuffer;
/**
* @author <NAME>
*/
public final class OpenGLUtils {
public static final String MODEL_VIEW_PROJECTION_MATRI... | Rasterizer/src/main/java/rasterizer/util/OpenGLUtils.java | 0.846562 | 0.419172 | OpenGLUtils.java | starcoder |
package model;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Objects;
public class Restaurant {
private final String restaurantID;
private final String restaurantName;
private final float latitude;
private final float longitude;
private final String city;
private ... | src/main/java/model/Restaurant.java | 0.894726 | 0.450359 | Restaurant.java | starcoder |
import static org.junit.Assert.*;
import org.junit.Test;
public class TestWorldState
{
@Test
public void testStoresLiteralsNoActors()
{
WorldState bindings = new WorldState();
Literal literal = new Literal(1);
bindings.addLiteral(literal);
Literal checker = new Literal(1)... | tests/TestWorldState.java | 0.806853 | 0.410106 | TestWorldState.java | starcoder |
package com.wubinet.model;
import java.math.BigDecimal;
import java.math.RoundingMode;
public class Co2D1Function {
private static final BigDecimal REFERENCE_VOLTAGE = new BigDecimal(2500);
private static final BigDecimal PRECISION = new BigDecimal(1024);
private static final BigDecimal TEMPERATURE_REF = new BigD... | src/main/java/com/wubinet/model/Co2D1Function.java | 0.90969 | 0.613642 | Co2D1Function.java | starcoder |
package ir.deepmine.speech.v1;
/**
* <pre>
* `StreamingRecognizeResponse` is the only message returned to the client by
* `BidiStreamingRecognize`. A series of zero or more `StreamingRecognizeResponse`
* messages are streamed back to the client. If there is no recognizable
* audio, and `single_utterance` is set ... | src/generated/main/java/ir/deepmine/speech/v1/StreamingRecognizeResponse.java | 0.906257 | 0.478285 | StreamingRecognizeResponse.java | starcoder |
package io.cdap.plugin;
import com.google.common.base.Joiner;
import com.google.common.base.Splitter;
import com.google.common.collect.Iterables;
import io.cdap.cdap.api.annotation.Description;
import io.cdap.cdap.api.annotation.Macro;
import io.cdap.cdap.api.annotation.Name;
import io.cdap.cdap.api.data.schema.Schema... | src/main/java/io/cdap/plugin/WindowAggregationConfig.java | 0.877175 | 0.416975 | WindowAggregationConfig.java | starcoder |
package com.github.tadukoo.parsing.code.java;
import com.github.tadukoo.util.ListUtil;
import com.github.tadukoo.util.tuple.Pair;
import org.junit.jupiter.api.Test;
import java.util.List;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import st... | TadukooJava/junit/com/github/tadukoo/parsing/code/java/JavaMethodTest.java | 0.771456 | 0.586345 | JavaMethodTest.java | starcoder |
package org.apache.tamaya.format;
import org.apache.tamaya.spi.PropertyValue;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
/**
* <p>Implementations current this class encapsulate the mechanism how to read a
* resource including interpreting the format correctly (e.g. xml vs.
* prop... | modules/formats/base/src/main/java/org/apache/tamaya/format/ConfigurationFormat.java | 0.867584 | 0.411466 | ConfigurationFormat.java | starcoder |
package org.apache.ivy.plugins.parser.m2;
import org.junit.Test;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
/**
* Tests {@link MavenVersionRangeParser}
*/
public class MavenVersionRangeParserTest {
/**
* Tests the {@link MavenVersionRangeParser#rangeAccepts(Str... | test/java/org/apache/ivy/plugins/parser/m2/MavenVersionRangeParserTest.java | 0.89913 | 0.703359 | MavenVersionRangeParserTest.java | starcoder |
package data_structures.tree.binary_tree;
import org.jetbrains.annotations.NotNull;
import java.util.Stack;
public class ConstructAndDisplayBinaryTreeUsingArray {
public static class Pair{
Node treeNode;
int state;
public Pair(Node treeNode, int state){
this.treeNode = treeNode... | src/data_structures/tree/binary_tree/ConstructAndDisplayBinaryTreeUsingArray.java | 0.64646 | 0.457197 | ConstructAndDisplayBinaryTreeUsingArray.java | starcoder |
package com.fyp.lun.rehabpartner;
/**
* Created by Lun on 30/1/2017.
*/
public class ComplementaryFilter
{
/* Setting up of constants */
double tau = 0.1, dt = 1/10;
double alpha = tau/(tau+dt);
// Main function to call all sub functions to calculate angles using ComplementaryFilter
public dou... | app/src/main/java/com/fyp/lun/rehabpartner/ComplementaryFilter.java | 0.655005 | 0.528168 | ComplementaryFilter.java | starcoder |
import java.awt.*;
import java.util.Objects;
import static java.lang.Double.max;
import static java.lang.StrictMath.abs;
import static java.lang.StrictMath.min;
/**
* Created by Admin on 22.10.17.
*/
public class Segment {
private final static double EPS = 1e-8;
/** * Концы отрезков. */
private ... | Lab_work_number_2/Lab_2/src/Segment.java | 0.774071 | 0.424949 | Segment.java | starcoder |
package ood;
public class InterfaceDemo {
public static void main(String[] args) {
Sellable sellable = new Photograph("Photo1", 23, true);
System.out.println(sellable.listPrice());
System.out.println(sellable.lowestPrice());
System.out.println(sellable.description());
Interf... | java/ood/InterfaceDemo.java | 0.592784 | 0.433202 | InterfaceDemo.java | starcoder |
package com.stevenha.splendor;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import org.junit.jupiter.api.DisplayName... | src/com/stevenha/splendor/PlayerTest.java | 0.525856 | 0.480357 | PlayerTest.java | starcoder |
package org.opensha.sha.earthquake.faultSysSolution.inversion.constraints.impl;
import java.util.List;
import org.opensha.sha.earthquake.faultSysSolution.FaultSystemRupSet;
import org.opensha.sha.earthquake.faultSysSolution.inversion.constraints.ConstraintWeightingType;
import org.opensha.sha.earthquake.faultSysSolut... | src/main/java/org/opensha/sha/earthquake/faultSysSolution/inversion/constraints/impl/PaleoRateInversionConstraint.java | 0.761538 | 0.445891 | PaleoRateInversionConstraint.java | starcoder |
package io.patriot_framework.generator.device.passive.actuators.stateMachine;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Future;
/**
* Transition are used by {@link StateMachine} to logically specify an reaction of StateMachine
* on incoming event. If desired, Transition can perform ... | src/main/java/io/patriot_framework/generator/device/passive/actuators/stateMachine/Transition.java | 0.897111 | 0.4436 | Transition.java | starcoder |
package com.jamesshore.finances.domain;
import static org.junit.Assert.*;
import org.junit.*;
import com.jamesshore.finances.values.*;
public class _StockMarketYearTest {
private static final Year YEAR = new Year(2010);
private static final GrowthRate INTEREST_RATE = new GrowthRate(10);
private static final Doll... | src/com/jamesshore/finances/domain/_StockMarketYearTest.java | 0.809238 | 0.740925 | _StockMarketYearTest.java | starcoder |
package org.dynmap.hdmap.renderer;
import java.util.ArrayList;
import java.util.BitSet;
import java.util.List;
import java.util.Map;
import org.dynmap.renderer.CustomRenderer;
import org.dynmap.renderer.DynmapBlockState;
import org.dynmap.renderer.MapDataContext;
import org.dynmap.renderer.RenderPatch;
import org.dyn... | DynmapCore/src/main/java/org/dynmap/hdmap/renderer/CopyStairBlockRenderer.java | 0.635901 | 0.420302 | CopyStairBlockRenderer.java | starcoder |
package com.yo.algorithm.practise.leetcode.maxdepth;
import java.util.concurrent.ConcurrentLinkedQueue;
public class MaxDepthOfBinaryTree {
/**
* @param args
*/
public static void main(String[] args) {
TreeNode root = new TreeNode(1);
TreeNode left = new TreeNode(3);
TreeNode right = new TreeNode(2);
T... | src/com/yo/algorithm/practise/leetcode/maxdepth/MaxDepthOfBinaryTree.java | 0.624523 | 0.442817 | MaxDepthOfBinaryTree.java | starcoder |
package amazon;
import java.util.LinkedList;
import java.util.Queue;
/*
You have a map that marks the locations of treasure islands. Some of the map area has jagged rocks and dangerous reefs. Other areas are safe to sail in.
There are other explorers trying to find the treasure. So you must figure out a shortest rout... | src/amazon/TreasureIslandII.java | 0.584508 | 0.71398 | TreasureIslandII.java | starcoder |
package org.vatplanner.archiver.common;
import java.util.HashMap;
import java.util.Map;
/**
* Methods by which data can be packed.
* <p>
* ZIP methods are useful to offer maximum compatibility with minimum or no
* dependencies required to uncompress the result on a remote client. Files can
* be accessed randomly... | common/src/main/java/org/vatplanner/archiver/common/PackerMethod.java | 0.94081 | 0.529932 | PackerMethod.java | starcoder |
package de.ipvs.as.mbp.util;
import de.ipvs.as.mbp.domain.data_model.DataModelDataType;
import de.ipvs.as.mbp.domain.data_model.treelogic.DataModelTreeNode;
import org.bson.Document;
import java.util.*;
/**
* Provides methods to access a {@link Document} based on a given {@link de.ipvs.as.mbp.domain.data_m... | src/main/java/de/ipvs/as/mbp/util/DocumentReader.java | 0.907102 | 0.671309 | DocumentReader.java | starcoder |
package org.rhq.metrics.core;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import com.google.common.base.Objects;
/**
* The data retention settings configured and stored at the tenant level. This includes retention both raw and
* aggregated data. Note that data retention can also be confi... | core-api/src/main/java/org/rhq/metrics/core/RetentionSettings.java | 0.946461 | 0.438124 | RetentionSettings.java | starcoder |
package matrix;
import java.nio.FloatBuffer;
import vector.Vector1;
import vector.Vector1d;
/**
* Holds a 1-dimensional double matrix.
*
* @author <NAME>
*
*/
public class Matrix1d extends Matrix1 {
double m00;
public Matrix1d() {
m00 = 1;
}
public Matrix1d(double m00) {
this.m00 = m00;
}
public... | JAwesomeBase/src/matrix/Matrix1d.java | 0.905044 | 0.549218 | Matrix1d.java | starcoder |
package org.apache.flink.table.functions;
import org.apache.flink.annotation.PublicEvolving;
import org.apache.flink.util.Collector;
/**
* 用户定义的表聚合基类
* Base class for user-defined table aggregates.
*
* <p>The behavior of a {@link TableAggregateFunction} can be defined by implementing a series of
* custom methods... | flink-table/flink-table-common/src/main/java/org/apache/flink/table/functions/TableAggregateFunction.java | 0.773986 | 0.552721 | TableAggregateFunction.java | starcoder |
package q1000;
import org.junit.runner.RunWith;
import util.runner.Answer;
import util.runner.LeetCodeRunner;
import util.runner.TestData;
import util.runner.data.DataExpectation;
/**
* [Hard] 995. Minimum Number of K Consecutive Bit Flips
* https://leetcode.com/problems/minimum-number-of-k-consecutive-bit-flips/
... | src/main/java/q1000/Q995_MinimumNumberOfKConsecutiveBitFlips.java | 0.72027 | 0.453988 | Q995_MinimumNumberOfKConsecutiveBitFlips.java | starcoder |
package com.nickmlanglois.wfp3.api.statement;
/**
* The curve approximation technique free-form geometry statement.
*
* ctech technique resolution
*
* Free-form geometry statement.
*
* Specifies a curve approximation technique. The arguments specify the technique and resolution for
* the curve.
*
* You m... | src/main/java/com/nickmlanglois/wfp3/api/statement/CurveApprox.java | 0.92691 | 0.696991 | CurveApprox.java | starcoder |
package berkerdemoglu.engine.models.mesh;
import berkerdemoglu.engine.graphics.math.geometry.Axis;
import berkerdemoglu.engine.graphics.math.geometry.Polygon3D;
import berkerdemoglu.engine.graphics.math.geometry.PolygonComparator;
import berkerdemoglu.engine.graphics.math.geometry.ProjectionSettings;
import berkerdemo... | src/main/java/berkerdemoglu/engine/models/mesh/Mesh.java | 0.891729 | 0.778523 | Mesh.java | starcoder |
package algorithms;
import sample.Cell;
import sample.Edge;
import sample.RandomNum;
import java.util.ArrayList;
import java.util.List;
public class Kruskal {
private static int Size;
private static List<Edge> edges;
private static List<String> sets;
private static Cell[][] cells;
/**
* Th... | Code/src/main/java/algorithms/Kruskal.java | 0.75392 | 0.543106 | Kruskal.java | starcoder |
package org.kakara.engine.gameitems;
import org.kakara.engine.utils.RGBA;
import java.util.ArrayList;
import java.util.List;
/**
* The material to be used on meshes.
*/
public class Material {
public static final RGBA DEFAULT_COLOUR = new RGBA(255, 255, 255, 1.0f);
private float reflectance;
private T... | src/main/java/org/kakara/engine/gameitems/Material.java | 0.938089 | 0.506591 | Material.java | starcoder |
package fr.univ_artois.lgi2a.similar.extendedkernel.examples.lambdalife.model.agents.cell.micro;
import fr.univ_artois.lgi2a.similar.extendedkernel.examples.lambdalife.model.levels.LambdaLifeLevelList;
import fr.univ_artois.lgi2a.similar.microkernel.agents.IAgent4Engine;
import fr.univ_artois.lgi2a.similar.microkernel... | similar-extendedKernel-examples/src/main/java/fr/univ_artois/lgi2a/similar/extendedkernel/examples/lambdalife/model/agents/cell/micro/AgtCellPLSInMicroLevel.java | 0.808257 | 0.483587 | AgtCellPLSInMicroLevel.java | starcoder |
package uk.ac.sussex.gdsc.smlm.ga;
import java.util.Arrays;
import org.apache.commons.rng.UniformRandomProvider;
import org.apache.commons.rng.sampling.distribution.DiscreteSampler;
import uk.ac.sussex.gdsc.core.utils.SimpleArrayUtils;
import uk.ac.sussex.gdsc.core.utils.rng.PoissonSamplerUtils;
/**
* Recombine sequ... | src/main/java/uk/ac/sussex/gdsc/smlm/ga/SimpleRecombiner.java | 0.916412 | 0.511229 | SimpleRecombiner.java | starcoder |
package cat.udl.cig.utils;
import java.util.Random;
import java.math.BigInteger;
import java.util.ArrayList;
/**
* Auxiliar class to compute factorizations.
*
* @author <NAME>
*/
public class Factorization {
/*Auxiliar method*/
private static Boolean isSpsp(BigInteger n, BigInteger a)
{
BigI... | src/main/java/cat/udl/cig/utils/Factorization.java | 0.916498 | 0.545044 | Factorization.java | starcoder |
package aoc2021;
import java.io.FileNotFoundException;
import java.util.*;
import java.util.stream.Collectors;
public class Day13 {
public static void main(String[] args) throws FileNotFoundException {
List<String> data = Utils.readInputAsStringArray("day13.txt");
System.out.printf("Day 13, part... | src/main/java/aoc2021/Day13.java | 0.84607 | 0.438064 | Day13.java | starcoder |
class Solution {
// Here we say Prefix - meaning the starting part of the string, always.
public String longestCommonPrefix(String[] strs) {
if (strs.length == 0)
return "";
// Take the first string as prefix
String prefix = strs[0];
// Start from ... | easy/0014-LongestCommonPrefix.java | 0.816187 | 0.423995 | 0014-LongestCommonPrefix.java | starcoder |
package com.spencerwi.either;
import java.util.NoSuchElementException;
import java.util.function.Function;
import java.util.function.Supplier;
public abstract class Result<R> {
public static <R> Result<R> attempt(ExceptionThrowingSupplier<R> resultSupplier){
try {
R resultValue = resultSuppli... | src/main/java/com/spencerwi/either/Result.java | 0.781664 | 0.414366 | Result.java | starcoder |
package org.quiltmc.chasm.lang.ast;
import java.util.HashMap;
import java.util.Map;
import org.quiltmc.chasm.lang.ReductionContext;
import org.quiltmc.chasm.lang.op.Addable;
import org.quiltmc.chasm.lang.op.Equatable;
import org.quiltmc.chasm.lang.op.Subtractable;
public class BinaryExpression implements Expression ... | chasm-lang/src/main/java/org/quiltmc/chasm/lang/ast/BinaryExpression.java | 0.918277 | 0.425844 | BinaryExpression.java | starcoder |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.