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 org.drools.scenariosimulation.backend.expression;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/**
* This DTO holds info related to an expression evaluation.
* - successful: field represents status of involved evaluation (successful or failed);
* - pathToWrongValue: a li... | drools-scenario-simulation/drools-scenario-simulation-backend/src/main/java/org/drools/scenariosimulation/backend/expression/ExpressionEvaluatorResult.java | 0.872102 | 0.416381 | ExpressionEvaluatorResult.java | starcoder |
package ocotillo.graph.layout.fdl.modular;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import ocotillo.geometry.Box;
import ocotillo.geometry.Coordinates;
import ocotillo.geometry.Geom;
import ocotillo.geometry.Geom2D;
import ocotillo.geometry.GeomE;
import ocotillo.geometry.Polyg... | source/ocotillo/graph/layout/fdl/modular/ModularPostProcessing.java | 0.920825 | 0.605828 | ModularPostProcessing.java | starcoder |
package com.android.settings.search;
import static com.google.common.truth.Truth.assertThat;
import android.provider.SearchIndexablesContract;
import androidx.test.filters.SmallTest;
import androidx.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
@SmallTest
@RunWith(AndroidJUnit4... | tests/unit/src/com/android/settings/search/SearchIndexablesContractTest.java | 0.727201 | 0.428233 | SearchIndexablesContractTest.java | starcoder |
package org.apache.geode.cache.execute;
import java.util.Collection;
import java.util.Collections;
import org.apache.geode.cache.Region;
import org.apache.geode.lang.Identifiable;
import org.apache.geode.management.internal.security.ResourcePermissions;
import org.apache.geode.security.ResourcePermission;
/**
* Def... | geode-core/src/main/java/org/apache/geode/cache/execute/Function.java | 0.914391 | 0.434161 | Function.java | starcoder |
package org.firstinspires.ftc.teamcode.Experimental.Units;
public class Vector {
public enum MoveBehavior{
LineTo, RotateTo, QuadraticCurveTo, CubicCurveTo, StrafeTo
}
private double posX;
private double posY;
private double heading;
private Action action;
private int paramType;
... | TeamCode/src/main/java/org/firstinspires/ftc/teamcode/Experimental/Units/Vector.java | 0.834002 | 0.442215 | Vector.java | starcoder |
package com.nauvalatmaja.SimpleDrawingTool.model.shape;
import static com.nauvalatmaja.SimpleDrawingTool.Properties.*;
import java.awt.Rectangle;
import java.awt.geom.AffineTransform;
import java.awt.geom.Line2D;
import java.awt.geom.PathIterator;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
publ... | src/main/java/com/nauvalatmaja/SimpleDrawingTool/model/shape/DLine.java | 0.887253 | 0.485356 | DLine.java | starcoder |
package gov.sandia.cognition.learning.algorithm.perceptron;
import gov.sandia.cognition.learning.data.DefaultInputOutputPair;
import gov.sandia.cognition.math.matrix.VectorFactory;
import gov.sandia.cognition.math.matrix.mtj.SparseVectorFactoryMTJ;
import gov.sandia.cognition.math.matrix.mtj.Vector2;
import gov.sandia... | Components/LearningCore/Test/gov/sandia/cognition/learning/algorithm/perceptron/OnlinePerceptronTest.java | 0.905804 | 0.552781 | OnlinePerceptronTest.java | starcoder |
package com.LiangLliu.tools.time;
import com.LiangLliu.tools.model.Pair;
import java.time.DayOfWeek;
import java.time.LocalDate;
import java.time.temporal.TemporalAdjusters;
import java.time.temporal.WeekFields;
import java.util.ArrayList;
import java.util.List;
public class CalendarUtils {
/**
* ISO8061 ... | src/main/java/com/LiangLliu/tools/time/CalendarUtils.java | 0.616936 | 0.422743 | CalendarUtils.java | starcoder |
package gov.faa.ang.swac.common.datatypes;
import gov.faa.ang.swac.common.datatypes.Angle.Units;
import gov.faa.ang.swac.common.utilities.Mathematics;
import java.io.Serializable;
import java.lang.Math;
/**
* A 3D vector class for doing basic analytical geometry calculations in 3D.
* Mostly used for doing great ci... | swac-common/src/main/java/gov/faa/ang/swac/common/datatypes/Vector3D.java | 0.911119 | 0.648007 | Vector3D.java | starcoder |
package com.reason.lang.ocaml;
import com.intellij.psi.*;
import com.intellij.psi.util.*;
import com.reason.ide.files.*;
import com.reason.lang.core.psi.PsiType;
import com.reason.lang.core.psi.*;
import com.reason.lang.core.psi.impl.*;
import java.util.*;
import static com.intellij.psi.util.PsiTreeUtil.*;
@Suppres... | tests/com/reason/lang/ocaml/TypeParsingTest.java | 0.83868 | 0.443841 | TypeParsingTest.java | starcoder |
package com.mathymath.equationgenerator.Model;
import com.mathymath.equationgenerator.Model.Selection.ShapeSelection;
import java.math.BigDecimal;
public class Shapes extends Generator {
private final BigDecimal pi = new BigDecimal( Math.PI + "" );
public Shapes() {
super();
selectionList =... | app/src/main/java/com/mathymath/equationgenerator/Model/Shapes.java | 0.856107 | 0.439086 | Shapes.java | starcoder |
package us.ihmc.euclid.referenceFrame.interfaces;
import us.ihmc.euclid.geometry.interfaces.Pose2DBasics;
import us.ihmc.euclid.geometry.interfaces.Pose2DReadOnly;
import us.ihmc.euclid.geometry.interfaces.Pose3DReadOnly;
import us.ihmc.euclid.orientation.interfaces.Orientation2DReadOnly;
import us.ihmc.euclid.r... | src/frame/java/us/ihmc/euclid/referenceFrame/interfaces/FixedFramePose2DBasics.java | 0.939297 | 0.588002 | FixedFramePose2DBasics.java | starcoder |
package com.att.research.xacml.std;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import com.att.research.xacml.api.AttributeValue;
import com.att.research.xacml.api.Identifier;
import com.att.research.xacml.api.MissingAttributeDetail;
import com.att.res... | XACML/src/main/java/com/att/research/xacml/std/StdMutableMissingAttributeDetail.java | 0.895614 | 0.483161 | StdMutableMissingAttributeDetail.java | starcoder |
package com.dashlabs.dash.geo.s2.internal;
import com.google.common.geometry.*;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ConcurrentLinkedQueue;
/**
* User: blangel
* Date: 7/19/17
* Time: 1:34 PM
*
* Originally from {@code com.amazonaws.geo.s2.internal.S2Manager} in DynamoD... | src/main/java/com/dashlabs/dash/geo/s2/internal/S2Manager.java | 0.85567 | 0.53965 | S2Manager.java | starcoder |
package entities;
import java.awt.Color;
import java.util.Vector;
public class Player {
private String id;
private int total_country_number;
private Vector<Continent> ownedContinent = new Vector<Continent>();
private Vector<Card> ownedCard = new Vector<Card>();
private Color color;
private int army_to_place;
... | src/entities/Player.java | 0.867934 | 0.414603 | Player.java | starcoder |
package com.shijingsh.ai.jsat.linear;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* This class provides a base mechanism to create a Matrix 'view' from a list of
* {@link Vec} objects. The vector objects will be used to back the rows of the
* matrix, so changes to one a... | shijingsh-ai-jsat/src/main/java/com/shijingsh/ai/jsat/linear/MatrixOfVecs.java | 0.920513 | 0.531817 | MatrixOfVecs.java | starcoder |
package com.fishercoder.solutions;
import java.util.Collections;
import java.util.PriorityQueue;
/**
* 480. Sliding Window Median
*
* Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of the two middle value.
Examples:
[2,... | src/main/java/com/fishercoder/solutions/_480.java | 0.920763 | 0.642881 | _480.java | starcoder |
* <p>JSO is a specification that describes how Java platform can interact with JavaScript code.
* There are two parts of this specification: JSO core, that defines mapping between Java and JavaScript
* objects and JSO APIs, that define Java wrappers around various JavaScript and HTML5 APIs.
* The latter part is sim... | jso/core/src/main/java/org/teavm/jso/package-info.java | 0.894138 | 0.621369 | package-info.java | starcoder |
package org.beryx.streamplify.combination;
import org.beryx.streamplify.IntArraySupplier;
import org.beryx.streamplify.Splittable;
import org.beryx.streamplify.shared.Unranking;
import java.math.BigInteger;
/**
* A value supplier for combinations.
* <br>It may compute the next combination based on the current one,... | streamplify/src/main/java/org/beryx/streamplify/combination/CombinationSupplier.java | 0.881168 | 0.461259 | CombinationSupplier.java | starcoder |
package us.ihmc.simulationconstructionset.util.ground;
import javax.vecmath.Vector3d;
import us.ihmc.robotics.geometry.BoundingBox3d;
public class StairGroundProfile extends GroundProfileFromHeightMap
{
private final BoundingBox3d boundingBox;
private final double groundXStep, groundZStep;
private final d... | SimulationConstructionSet/src/us/ihmc/simulationconstructionset/util/ground/StairGroundProfile.java | 0.876714 | 0.562177 | StairGroundProfile.java | starcoder |
package com.opengamma.analytics.financial.model.option.pricing.analytic.formula;
import org.apache.commons.lang.Validate;
import com.opengamma.analytics.financial.model.volatility.smile.fitting.interpolation.SABRExtrapolationLeftRightFunction;
import com.opengamma.analytics.financial.model.volatility.smile.function.S... | projects/OG-Analytics/src/main/java/com/opengamma/analytics/financial/model/option/pricing/analytic/formula/SABRExtrapolationRightFunction.java | 0.922487 | 0.708613 | SABRExtrapolationRightFunction.java | starcoder |
package org.jolokia.converter.object;
/*
* Copyright 2009-2011 <NAME>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unl... | agent/core/src/main/java/org/jolokia/converter/object/TabularDataConverter.java | 0.917525 | 0.441613 | TabularDataConverter.java | starcoder |
package org.cloudifysource.restDoclet.exampleGenerators;
import java.lang.reflect.*;
import java.util.*;
import java.util.logging.Logger;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.primitives.Pr... | src/main/java/org/cloudifysource/restDoclet/exampleGenerators/ObjectCreator.java | 0.864368 | 0.457924 | ObjectCreator.java | starcoder |
package org.elasticsearch.xpack.spatial.common;
import org.elasticsearch.ElasticsearchParseException;
import org.elasticsearch.common.xcontent.LoggingDeprecationHandler;
import org.elasticsearch.geometry.Geometry;
import org.elasticsearch.geometry.ShapeType;
import org.elasticsearch.geometry.utils.StandardValidator;
i... | x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/common/CartesianPoint.java | 0.842798 | 0.503662 | CartesianPoint.java | starcoder |
package com.opengamma.analytics.financial.provider.calculator.blackforex;
import com.opengamma.analytics.financial.forex.derivative.ForexOptionVanilla;
import com.opengamma.analytics.financial.forex.method.PresentValueForexBlackVolatilitySensitivity;
import com.opengamma.analytics.financial.forex.provider.ForexOptionV... | projects/OG-Analytics/src/main/java/com/opengamma/analytics/financial/provider/calculator/blackforex/PresentValueForexVolatilitySensitivityForexBlackFlatCalculator.java | 0.915383 | 0.531209 | PresentValueForexVolatilitySensitivityForexBlackFlatCalculator.java | starcoder |
package boofcv.io.points;
import boofcv.alg.cloud.AccessColorIndex;
import boofcv.alg.cloud.AccessPointIndex;
import boofcv.alg.cloud.PointCloudReader;
import boofcv.alg.cloud.PointCloudWriter;
import boofcv.io.points.impl.PlyCodec;
import boofcv.struct.Point3dRgbI_F64;
import georegression.struct.point.Point3D_F32;
i... | main/boofcv-io/src/main/java/boofcv/io/points/PointCloudIO.java | 0.83128 | 0.458652 | PointCloudIO.java | starcoder |
package engine.entities;
import database.firebase.TrackableObject;
import util.math.num.Vector;
/**Wrapper Class for Entity's position/location/scale
* @author lasia
* @author Albert
*
*/
public class Transform extends TrackableObject {
private Vector myPosition = new Vector(0, 0);
private Vector myVelocity = n... | src/engine/entities/Transform.java | 0.903761 | 0.492554 | Transform.java | starcoder |
package uk.gov.hmcts.reform.bulkscanccdeventhandler;
import io.restassured.mapper.ObjectMapperType;
import io.restassured.response.Response;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.... | src/functionalTest/java/uk/gov/hmcts/reform/bulkscanccdeventhandler/OcrFormValidationTest.java | 0.851135 | 0.431105 | OcrFormValidationTest.java | starcoder |
package org.dew.fhir.model;
import java.io.Serializable;
/**
*
* Source material shall capture information on the taxonomic and anatomical origins as well as the fraction of a material that can result in or can be modified to form a substance. This set of data elements shall be used to define polymer substances iso... | src/main/java/org/dew/fhir/model/SubstanceSourceMaterialOrganismGeneral.java | 0.911955 | 0.461684 | SubstanceSourceMaterialOrganismGeneral.java | starcoder |
package de.leonhard.storage.internal;
import de.leonhard.storage.internal.settings.DataType;
import de.leonhard.storage.util.JsonUtils;
import org.json.JSONObject;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
/**
* An extended HashMap, to easily process
* the nest... | src/main/java/de/leonhard/storage/internal/FileData.java | 0.804636 | 0.40645 | FileData.java | starcoder |
package algorithm;
/*
System.arraycopy는 native 메서드로 직접 루프를 돌려 배열을 복사하는것보다 성능이 2배이상 빠르며, Arrays.copyOf는 내부적으로 System.arraycopy을 호출한다
https://stackoverflow.com/questions/18638743/is-it-better-to-use-system-arraycopy-than-a-for-loop-for-copying-arrays
System.arraycopy 사용 방법
Object src : 복사하고자 하는 배열. 즉, 원본 배열이라고 생각하면 된다... | src/main/java/algorithm/MergeSort.java | 0.671471 | 0.682564 | MergeSort.java | starcoder |
package com.emitrom.ti4j.mobile.client.ui.interfaces;
import com.emitrom.ti4j.mobile.client.core.Unit;
public interface HasBackgroundPosition {
public void setBackgroundColor(String value);
/**
* @return End caps specify the portion of an image that should not be
* resized when an image is... | src/com/emitrom/ti4j/mobile/client/ui/interfaces/HasBackgroundPosition.java | 0.825871 | 0.442637 | HasBackgroundPosition.java | starcoder |
package com.rtg.util.intervals;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import com.rtg.util.diagnostic.NoTalkbackSlimException;
/**
* A structure that holds multiple ranges that can be searched for a point within the ranges.... | src/com/rtg/util/intervals/RangeList.java | 0.937218 | 0.530905 | RangeList.java | starcoder |
package com.alyxferrari.neo3d.obj;
/** Represents a point in 3D space.
* @author <NAME>
* @since 1.0 alpha
*/
public class Vector3D {
/** This vector's x value.
*/
protected float x;
/** This vector's y value.
*/
protected float y;
/** This vector's z value.
*/
protected float z;
/** This vector's color... | src/com/alyxferrari/neo3d/obj/Vector3D.java | 0.921878 | 0.583114 | Vector3D.java | starcoder |
package problem;
import java.util.*;
/**House Robber
* <link> https://leetcode.com/problems/house-robber/description/
*
* You are a professional robber planning to rob houses along a street. Each
* house has a certain amount of money sashed, the only constraint stopping you
* from robbing each of them is that a... | problem/HouseRobberI.java | 0.858051 | 0.402451 | HouseRobberI.java | starcoder |
package com.badlogic.gdx.physics.box2d.joints;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.physics.box2d.Joint;
import com.badlogic.gdx.physics.box2d.World;
/** A motor joint is used to control the relative motion between two bodies. A typical usage is to control the movement of a
* dynamic body wi... | extensions/gdx-box2d/gdx-box2d/src/com/badlogic/gdx/physics/box2d/joints/MotorJoint.java | 0.851737 | 0.613381 | MotorJoint.java | starcoder |
package io.gomint.taglib;
import java.io.IOException;
import java.math.BigInteger;
/**
* @author geNAZt
* @version 1.0
*/
class VarInt {
private static final BigInteger UNSIGNED_LONG_MAX_VALUE = new BigInteger( "FFFFFFFFFFFFFFFF", 16 );
private static long encodeZigZag32( int v ) {
return (long) ... | src/main/java/io/gomint/taglib/VarInt.java | 0.874091 | 0.510558 | VarInt.java | starcoder |
package com.bluegosling.concurrent;
import static java.util.Objects.requireNonNull;
import java.math.BigInteger;
import java.util.Iterator;
import java.util.Random;
import java.util.concurrent.TimeUnit;
/**
* Represents a duration of time that is backed by an integral length and a unit.
*
* <p>When two durations ... | src/com/bluegosling/concurrent/Duration.java | 0.947149 | 0.770335 | Duration.java | starcoder |
package com.team1678.frc2021.states;
import com.team254.lib.util.InterpolatingDouble;
import com.team254.lib.util.InterpolatingTreeMap;
import com.team254.lib.util.PolynomialRegression;
public class SuperstructureConstants {
public static final double kTurretPaddingDegrees = 3;
public static final double kH... | src/main/java/com/team1678/frc2021/states/SuperstructureConstants.java | 0.680879 | 0.549701 | SuperstructureConstants.java | starcoder |
package a06_sorting_searching;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Set;
/**
* You are given two string arrays username and website and an integer array tim... | src/main/java/a06_sorting_searching/UserWebsiteVisitPattern.java | 0.855655 | 0.471102 | UserWebsiteVisitPattern.java | starcoder |
package com.piratecatai.game;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.physics.box2d.*;
public class BodyCreator {
private static World world;
private static BodyCreator thisInstance;
public static final int STEEL = 0;
public static final int WOOD = 1;
public static final int... | core/src/com/piratecatai/game/BodyCreator.java | 0.76074 | 0.556641 | BodyCreator.java | starcoder |
package de.openhpi.squash.model;
public class Point {
public static final float EPSILON = 1E-4f;
public float x;
public float y;
public Point(){
set(0, 0);
}
public Point(float x, float y) {
set(x, y);
}
public void set(float x, float y){
this.x = x;
... | src/de/openhpi/squash/model/Point.java | 0.833087 | 0.564759 | Point.java | starcoder |
package org.apache.commons.math3.random;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.charset.Charset;
import java.util.Arrays;
import java.util.NoSuchElementException;
import java.util.StringTokenizer;
import org.apache.commo... | src/main/java/org/apache/commons/math3/random/SobolSequenceGenerator.java | 0.917939 | 0.455138 | SobolSequenceGenerator.java | starcoder |
package codeu.chat.util;
import java.io.IOException;
import static org.junit.Assert.*;
import org.junit.Test;
public final class UuidTest {
@Test
public void testBadId() {
assertNotNull(Uuid.NULL);
assertEquals(Uuid.NULL.root(), null);
assertEquals(Uuid.NULL.id(), 0);
}
@Test
public void test... | test/codeu/chat/util/UuidTest.java | 0.902323 | 0.557062 | UuidTest.java | starcoder |
package com.jayantkrish.jklol.models.dynamic;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.jayantkrish.jklol.util.Assignment;
/... | src/com/jayantkrish/jklol/models/dynamic/DynamicAssignment.java | 0.923713 | 0.596345 | DynamicAssignment.java | starcoder |
package arcadia.util;
import java.awt.*;
import java.awt.geom.*;
import java.util.*;
public class SkyhookFont {
private final double size;
public SkyhookFont(int size) {
this.size = size;
}
public Point2D draw(Graphics2D g2d, Point2D ul, String string) {
Stroke stroke = g2d.getStroke();
g2d.setStroke(new... | src/arcadia/util/SkyhookFont.java | 0.582729 | 0.431644 | SkyhookFont.java | starcoder |
package io.cdap.functions;
/**
* The collection of logical functions that operate on bit.
*/
public final class Logical {
/**
* Don't let anyone instantiate this class.
*/
private Logical() {}
/**
* Bitwise 'AND' operation of two numbers. The inputs must be non-null.
*
* @param num1 first numb... | wrangler-core/src/main/java/io/cdap/functions/Logical.java | 0.93426 | 0.736353 | Logical.java | starcoder |
package depth_first_search;
import java.util.*;
/**
* Created by gouthamvidyapradhan on 15/12/2017.
* Given an unsorted array of integers, find the length of the longest consecutive elements sequence.
For example,
Given [100, 4, 200, 1, 3, 2],
The longest consecutive elements sequence is [1, 2, 3, 4]. Return it... | java/tag/depth_first_search/LongestConsecutiveSequence.java | 0.894967 | 0.527864 | LongestConsecutiveSequence.java | starcoder |
package com.example.anan.AAChartCore.AAChartCoreLib.AATools;
public class AAColor {
public static String Black = blackColor();
public static String DarkGray = darkGrayColor();
public static String LightGray = lightGrayColor();
public static String White = whiteColor();
public static String Gray = g... | app/src/main/java/com/example/anan/AAChartCore/AAChartCoreLib/AATools/AAColor.java | 0.834508 | 0.438485 | AAColor.java | starcoder |
package org.moeaframework.problem.LZ;
import java.util.ArrayList;
import java.util.List;
import org.moeaframework.core.Solution;
import org.moeaframework.core.variable.EncodingUtils;
import org.moeaframework.core.variable.RealVariable;
import org.moeaframework.problem.AbstractProblem;
/*
* The following ... | src/org/moeaframework/problem/LZ/LZ.java | 0.821796 | 0.419588 | LZ.java | starcoder |
package org.lwjgl.opengles;
/**
* Native bindings to the <a href="https://www.khronos.org/registry/gles/extensions/AMD/AMD_compressed_3DC_texture.txt">AMD_compressed_3DC_texture</a> extension.
*
* <p>Two compression formats are introduced:</p>
*
* <ul>
* <li>A compression format for two component textures. Whe... | 04lwjgl/code/lwjgl/org/lwjgl/opengles/AMDCompressed3DCTexture.java | 0.895134 | 0.749408 | AMDCompressed3DCTexture.java | starcoder |
package gov.sandia.cognition.learning.function.scalar;
/**
* Unit tests for class LinearFunction.
*
* @author <NAME>
* @author <NAME>
*/
public class LinearFunctionTest
extends DifferentiableUnivariateScalarFunctionTestHarness
{
/**
* Entry point for JUnit tests for class LinearFunctionTest
*... | Components/LearningCore/Test/gov/sandia/cognition/learning/function/scalar/LinearFunctionTest.java | 0.94688 | 0.475849 | LinearFunctionTest.java | starcoder |
package com.microsoft.azure.management.servicefabric.v2018_02_01;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Represents the delta health policy used to evaluate the health of services
* belonging to a service type when upgrading the cluster.
*/
public class ServiceTypeDeltaHealthPolicy {
/**
... | sdk/servicefabric/mgmt-v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ServiceTypeDeltaHealthPolicy.java | 0.909574 | 0.50238 | ServiceTypeDeltaHealthPolicy.java | starcoder |
package adiitya.tictactoe;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.g2d.Animation;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.TextureAtlas.AtlasRegion;
import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.math.Rectangle;
import java.util.Obje... | core/src/main/java/adiitya/tictactoe/Cell.java | 0.788543 | 0.517815 | Cell.java | starcoder |
package com.stb.transformations;
import org.apache.spark.api.java.function.FilterFunction;
import org.apache.spark.sql.Dataset;
import org.apache.spark.sql.Row;
public class FilterExample {
public static void main(String[] args) {
Dataset<Row> customerData = SourceAndSink.readStreamCsv("Filter Function", ... | src/main/java/com/stb/transformations/FilterExample.java | 0.542379 | 0.484441 | FilterExample.java | starcoder |
package org.anstis.client.grid.model;
import java.util.List;
/**
* An interface defining a generic grid of data.
* @param <R> The generic type of rows within the grid
* @param <C> The generic type of columns within the grid
* @param <V> The generic type of cells within the grid
*/
public interface IGridData<R ex... | src/main/java/org/anstis/client/grid/model/IGridData.java | 0.900434 | 0.638314 | IGridData.java | starcoder |
package dev.sgora.observetree;
import dev.sgora.observetree.enums.ListenerNotification;
import dev.sgora.observetree.enums.ListenerPriority;
import dev.sgora.observetree.listener.ChangeListener;
import dev.sgora.observetree.listener.ListenerEntry;
import java.util.HashSet;
import java.util.Optional;
import java.util.... | src/main/java/dev/sgora/observetree/Observable.java | 0.851675 | 0.412175 | Observable.java | starcoder |
package com.asha.vrlib.model.position;
import android.opengl.Matrix;
import com.asha.vrlib.model.MDPosition;
import static com.asha.vrlib.common.VRUtil.checkGLThread;
import static com.asha.vrlib.common.VRUtil.notNull;
/**
* Created by hzqiujiadi on 2017/4/11.
* hzqiujiadi <EMAIL>
*/
public class MDMutablePosit... | vrlib/src/main/java/com/asha/vrlib/model/position/MDMutablePosition.java | 0.914906 | 0.510741 | MDMutablePosition.java | starcoder |
package katas.java.moocjava8;
import java.io.BufferedReader;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;
import java.util.stream.Stream;
import stat... | java/src/main/java/katas/java/moocjava8/Lesson2.java | 0.745769 | 0.456894 | Lesson2.java | starcoder |
package com.parrot.drone.groundsdk.internal.device.peripheral;
import android.support.annotation.NonNull;
import com.parrot.drone.groundsdk.LocationMatcher;
import com.parrot.drone.groundsdk.device.peripheral.Geofence;
import com.parrot.drone.groundsdk.device.peripheral.Peripheral;
import com.parrot.drone.groundsdk.i... | groundsdk/src/androidTest/java/com/parrot/drone/groundsdk/internal/device/peripheral/GeofenceTest.java | 0.856962 | 0.47025 | GeofenceTest.java | starcoder |
package edu.hm.hafner.analysis;
import java.io.Serializable;
import java.util.AbstractList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;
import java.util.NoSuchElementException;
import java.util.strea... | src/main/java/edu/hm/hafner/analysis/LineRangeList.java | 0.954223 | 0.518973 | LineRangeList.java | starcoder |
package cgeo.geocaching.filters.core;
import cgeo.geocaching.R;
import cgeo.geocaching.models.Geocache;
import cgeo.geocaching.storage.SqlBuilder;
import cgeo.geocaching.utils.LocalizationUtils;
import java.util.HashMap;
import java.util.Map;
public class StoredSinceGeocacheFilter extends NumberRangeGeocacheFilter<L... | main/src/cgeo/geocaching/filters/core/StoredSinceGeocacheFilter.java | 0.888958 | 0.433562 | StoredSinceGeocacheFilter.java | starcoder |
package org.openimaj.ml.dataset;
import gov.sandia.cognition.math.matrix.Vector;
import gov.sandia.cognition.math.matrix.VectorFactory;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import org.apache.logging.log4j.Logger;
imp... | machine-learning/machine-learning/src/main/java/org/openimaj/ml/dataset/WineDataset.java | 0.744563 | 0.407157 | WineDataset.java | starcoder |
package com.alexiscv.t9ej1_misiles;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.view.View;
public class Grafico {
private Drawable drawable; // Imagen a dibujar
private double posX, posY; // Posición del gráfico (en nuestro caso misil)
private double incX, ... | T9Ej1_Misiles/app/src/main/java/com/alexiscv/t9ej1_misiles/Grafico.java | 0.691185 | 0.471892 | Grafico.java | starcoder |
public class QuadTreePlayground {
/**
* This is a simple program that creates a quad tree with many points
* as well as a rectangle, and tries to find the most points that can
* be inside that rectangle by varying position.
* @param args
*/
public static void main(String[] args) {
... | src/QuadTreePlayground.java | 0.886377 | 0.633609 | QuadTreePlayground.java | starcoder |
package com.example.bot.spring;
import java.sql.DatabaseMetaData;
/**
* InputChecker will perform the function of checking whether users' inputs are correct
* and updating the database corresponding to different input
* @version 1.0
* @since 2017/11/19
*/
public class InputChecker {
/**
* This method will check wh... | sample-spring-boot-kitchensink/src/main/java/com/example/bot/spring/InputChecker.java | 0.813683 | 0.416559 | InputChecker.java | starcoder |
package org.robotframework.ide.eclipse.main.plugin.tableeditor.source.colouring;
import static com.google.common.collect.Lists.newArrayList;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
i... | src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin.tests/src/org/robotframework/ide/eclipse/main/plugin/tableeditor/source/colouring/TokenTypeBasedRuleTest.java | 0.882624 | 0.494507 | TokenTypeBasedRuleTest.java | starcoder |
package io.prestosql.execution.buffer;
import java.util.Arrays;
import java.util.stream.Collectors;
import static com.google.common.base.MoreObjects.toStringHelper;
import static com.google.common.base.Preconditions.checkArgument;
/**
* Encodes boolean properties for {@link SerializedPage} by using a bitmasking str... | presto-main/src/main/java/io/prestosql/execution/buffer/PageCodecMarker.java | 0.934597 | 0.421314 | PageCodecMarker.java | starcoder |
class BSTIterator {
Stack<TreeNode> stack;
public BSTIterator(TreeNode root) {
this.stack = new Stack();
inorder(root);
}
private void inorder(TreeNode root) {
while(root != null) {
this.stack.push(root);
root = root.left;
}
}
public int... | Tree/Java/173_Binary_Search_Tree_Iterator.java | 0.872822 | 0.637962 | 173_Binary_Search_Tree_Iterator.java | starcoder |
package de.jungblut.classification;
import de.jungblut.math.DoubleVector;
/**
* Classifier interface for predicting categorial variables.
*
* @author thomas.jungblut
*
*/
public interface Classifier {
/**
* Trains this classifier with the given features and the outcome.
*
* @param outcome the outc... | src/de/jungblut/classification/Classifier.java | 0.896413 | 0.744563 | Classifier.java | starcoder |
package org.apache.commons.configuration2;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Properties;
import org.apache.commons.configuration2.ex.ConversionException;
/**
* <p>The main interface for accessing ... | src/main/java/org/apache/commons/configuration2/ImmutableConfiguration.java | 0.955345 | 0.491212 | ImmutableConfiguration.java | starcoder |
package gov.sandia.cognition.learning.algorithm.minimization;
import gov.sandia.cognition.algorithm.AnytimeAlgorithm;
import gov.sandia.cognition.evaluator.Evaluator;
import gov.sandia.cognition.learning.algorithm.BatchLearner;
import gov.sandia.cognition.learning.algorithm.regression.ParameterCostMinimizer;
import go... | Components/LearningCore/Source/gov/sandia/cognition/learning/algorithm/minimization/FunctionMinimizer.java | 0.940953 | 0.655412 | FunctionMinimizer.java | starcoder |
package com.moparisthebest.poi.hssf.record.chart;
import com.moparisthebest.poi.hssf.record.RecordInputStream;
import com.moparisthebest.poi.hssf.record.StandardRecord;
import com.moparisthebest.poi.util.BitField;
import com.moparisthebest.poi.util.BitFieldFactory;
import com.moparisthebest.poi.util.HexDump;
import co... | src/main/java/com/moparisthebest/poi/hssf/record/chart/SeriesLabelsRecord.java | 0.778523 | 0.413063 | SeriesLabelsRecord.java | starcoder |
package com.androidplot.ui;
import android.graphics.RectF;
import com.androidplot.util.PixelUtils;
/**
* Defines physical dimensions & scaling characteristics
*/
public class Size {
// convenience value; sets size to 100% width and height of the widget container.
public static Size FILL = new Size(0, SizeL... | androidplot-core/src/main/java/com/androidplot/ui/Size.java | 0.951346 | 0.558869 | Size.java | starcoder |
package cc.duduhuo.util.pojo.derivation.samplebase.pojo;
import cc.duduhuo.util.pojo.derivation.annotation.DerivationConstructorExclude;
import cc.duduhuo.util.pojo.derivation.samplebase.anno.TestAnno1;
import cc.duduhuo.util.pojo.derivation.samplebase.anno.TestAnno2;
import cc.duduhuo.util.pojo.derivation.samplebase.... | sample/sample-base/src/main/java/cc/duduhuo/util/pojo/derivation/samplebase/pojo/TestA.java | 0.766381 | 0.435121 | TestA.java | starcoder |
package us.ihmc.sensorProcessing.bubo.desc.sensors.lrf2d;
import georegression.struct.point.Point2D_F64;
import georegression.struct.point.Vector2D_F64;
/**
* <p>
* To cut down on the required computations when computing the location of each LRF scan point in 2D cartesian
* coordinates in the sensors reference fra... | SensorProcessing/src/us/ihmc/sensorProcessing/bubo/desc/sensors/lrf2d/Lrf2dPrecomputedTrig.java | 0.591487 | 0.745861 | Lrf2dPrecomputedTrig.java | starcoder |
package io.github.resilience4j.circuitbreaker.internal;
import io.github.resilience4j.circuitbreaker.CircuitBreaker;
import java.time.Duration;
import java.time.Instant;
final class OpenState extends CircuitBreakerState {
// 打开状态的持续时间,在配置类CircuitBreakerConfig的实例中已设置
private final Instant retryAfterWaitDurati... | resilience4j-circuitbreaker/src/main/java/io/github/resilience4j/circuitbreaker/internal/OpenState.java | 0.573201 | 0.414247 | OpenState.java | starcoder |
public class MarsRover {
private final int boardX;
private final int boardY;
private int currentX;
private int currentY;
private Character facing;
/**
* Defines the board with a rover.
*
* @param boardX x size of the board
* @param boardY y size of the board
*/
pub... | rover-procedural/src/main/java/MarsRover.java | 0.919362 | 0.459379 | MarsRover.java | starcoder |
package io.github.movementspeed.nhglib.core.ecs.components.physics;
import com.artemis.Component;
import com.badlogic.gdx.graphics.Mesh;
import com.badlogic.gdx.graphics.g3d.Model;
import com.badlogic.gdx.math.Matrix4;
import com.badlogic.gdx.math.Quaternion;
import com.badlogic.gdx.math.Vector3;
import com.badlogic.g... | nhglib-core/src/io/github/movementspeed/nhglib/core/ecs/components/physics/RigidBodyComponent.java | 0.829319 | 0.425367 | RigidBodyComponent.java | starcoder |
package android.view.textservice;
import android.os.Parcel;
import android.os.Parcelable;
import java.util.Arrays;
/**
* This class contains a metadata of suggestions returned from a text service
* (e.g. {@link android.service.textservice.SpellCheckerService}).
* The text service uses this class to return the sug... | core/java/android/view/textservice/SentenceSuggestionsInfo.java | 0.921039 | 0.496155 | SentenceSuggestionsInfo.java | starcoder |
package boofcv.alg.filter.blur;
import boofcv.alg.InputSanityCheck;
import boofcv.alg.filter.blur.impl.*;
import boofcv.alg.filter.convolve.ConvolveImageMean;
import boofcv.alg.filter.convolve.ConvolveImageNormalized;
import boofcv.concurrency.BoofConcurrency;
import boofcv.core.image.GeneralizedImageOps;
import boofc... | main/boofcv-ip/src/main/java/boofcv/alg/filter/blur/BlurImageOps.java | 0.897403 | 0.541712 | BlurImageOps.java | starcoder |
package um.numeric.odesolvers;
import um.numeric.odesolvers.multistep.AdamsBashforth4;
public class PredictorCorrector4 implements AdaptiveMultiStepSolver {
private InitialValueProblem problem;
private AdamsBashforth4 predictor;
private double tolerance;
private double currentStep;
private double minimumSte... | src/main/java/um/numeric/odesolvers/adaptivemultistep/PredictorCorrector4.java | 0.889834 | 0.427636 | PredictorCorrector4.java | starcoder |
package org.xchain.framework.sax;
import java.util.Map;
import java.util.HashMap;
import java.util.Set;
import java.util.LinkedList;
/**
* The <code>PrefixMapping</code> class keeps track of the current NamespaceURI for a Prefix. The NamespaceURIs for a Prefix are kept in a stack.
* When a new NamespaceURI is ad... | core/src/main/java/org/xchain/framework/sax/PrefixMappingContext.java | 0.868227 | 0.470919 | PrefixMappingContext.java | starcoder |
package io.ayte.utility.function;
import lombok.RequiredArgsConstructor;
import java.util.Collection;
import java.util.Comparator;
import java.util.Objects;
import java.util.function.Function;
import java.util.function.Predicate;
public class Predicates {
public static final AnyTrue ANY_TRUE = new AnyTrue();
... | src/main/java/io/ayte/utility/function/Predicates.java | 0.919136 | 0.60871 | Predicates.java | starcoder |
package org.apache.cassandra.db.rows;
import java.util.Iterator;
import org.apache.cassandra.config.ColumnDefinition;
import org.apache.cassandra.db.*;
import org.apache.cassandra.utils.SearchIterator;
public abstract class AbstractReusableRow extends AbstractRow
{
private CellData.ReusableCell simpleCell;
p... | src/java/org/apache/cassandra/db/rows/AbstractReusableRow.java | 0.695235 | 0.430147 | AbstractReusableRow.java | starcoder |
package pl.shockah.unicorn.algo.tsp;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java8.util.Comparators;
import java8.util.function.Function;
import java8.util.function.Predicate;
impor... | algorithm/src/pl/shockah/unicorn/algo/tsp/NearestNeighborTravellingSalesmanSolver.java | 0.813424 | 0.441312 | NearestNeighborTravellingSalesmanSolver.java | starcoder |
import java.util.NoSuchElementException;
public class GenericTester<T>
{
/***
* 1. Chapter 5, Exercise #11, page 252, occurrences.
* In this context, the method is static, and an array
* is passed in as an argument
*
* Iterates an array of objects of type 'T', looking for a target object.
* @param <T>... | CS_211/GenericTester.java | 0.767254 | 0.463384 | GenericTester.java | starcoder |
package com.roguecloud.utils;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.PriorityQueue;
import com.roguecloud.Position;
import com.roguecloud.map.IMap;
import com.roguecloud.map.Tile;
/**
* This class may ... | src/main/java/com/roguecloud/utils/AStarSearch.java | 0.858837 | 0.449393 | AStarSearch.java | starcoder |
package org.moeaframework.examples.ga.tsplib;
import java.io.BufferedReader;
import java.io.EOFException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Queue;
/**
* Stores the edges in a graph.
*/
public class EdgeData extends DistanceTa... | Software/MOEAFramework-2.12/examples/org/moeaframework/examples/ga/tsplib/EdgeData.java | 0.815673 | 0.406096 | EdgeData.java | starcoder |
Solution 1: Brute Force (Time Limit Exceeded)
O(n1*n2) runtime and O(1) space complexities, where n1 is the length of headA and n2 that of headB
Solution 2: Using a hash:
Traverse the 1st list and store the address reference to each node in a hash set. Then check every node in the 2nd list;
if it appears in the h... | leetcode/java/prob160IntersectionOf2LinkedLists/GetIntersectionNode.java | 0.930695 | 0.936256 | GetIntersectionNode.java | starcoder |
package de.rub.nds.ipsec.statemachineextractor.util;
import java.util.HashMap;
import java.util.Map;
/**
* The Internet Protocol numbers found in the Protocol field of the IPv4 header
* and the Next Header field of the IPv6 header. Based on the Assigned Internet
* Protocol Numbers list maintained be IANA.
*
* @s... | src/main/java/de/rub/nds/ipsec/statemachineextractor/util/IPProtocolsEnum.java | 0.776199 | 0.421195 | IPProtocolsEnum.java | starcoder |
package voltric.util.distance;
import org.apache.commons.lang3.NotImplementedException;
import org.apache.commons.math3.util.Combinations;
import voltric.inference.CliqueTreePropagation;
import voltric.model.DiscreteBayesNet;
import voltric.potential.Function;
import voltric.variables.DiscreteVariable;
import java.ut... | src/main/java/voltric/util/distance/Bhattacharyya.java | 0.727104 | 0.554651 | Bhattacharyya.java | starcoder |
package org.apache.openjpa.persistence.query;
/**
* Interface for operations over objects reached via paths
*/
public interface PathExpression extends Expression {
/**
* Return a path expression corresponding to the referenced attribute. It is
* not permitted to invoke this method on a path expression ... | openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/PathExpression.java | 0.933937 | 0.541409 | PathExpression.java | starcoder |
package com.cinchapi.common.base;
/**
* A collection of functions to either successfully verify a condition or throw
* an exception.
*
* @author <NAME>
*/
public final class Verify {
/**
* Verify that {@code object} is {@link Class#isAssignableFrom(Class) an
* instance of} {@code type} or throw a ... | src/main/java/com/cinchapi/common/base/Verify.java | 0.939568 | 0.415729 | Verify.java | starcoder |
package burlap.behavior.stochasticgames.agents.twoplayer.singlestage.equilibriumplayer;
/**
* This abstract class is used for computing the strategies according to a solution concept for a single stage bimatrix game.
* The {@link #solve(double[][], double[][])} method takes as input the payoff matrice for the row a... | Assignment4/BURLAP/src/burlap/behavior/stochasticgames/agents/twoplayer/singlestage/equilibriumplayer/BimatrixEquilibriumSolver.java | 0.892234 | 0.823648 | BimatrixEquilibriumSolver.java | starcoder |
package org.apache.hadoop.hbase.client;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;
import org.apache.hadoop.hbase.HRegionLocation;
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.util.Pair;
import org.apache.yetus.audience.Interfac... | hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncTableRegionLocator.java | 0.928344 | 0.408365 | AsyncTableRegionLocator.java | starcoder |
package org.tinfour.common;
import java.util.List;
/**
* Defines an interface for collecting the points in the
* proximity of a specified pair of coordinates.
*/
public interface INeighborhoodPointsCollector extends IProcessUsingTin {
/**
* Gets the points in the neighborhood of a pair of query coordinates.
... | core/src/main/java/org/tinfour/common/INeighborhoodPointsCollector.java | 0.884264 | 0.81283 | INeighborhoodPointsCollector.java | starcoder |
package com.jogamp.newt.event;
import java.util.Arrays;
/**
* Pointer event of type {@link PointerType}.
* <p>
* The historical misleading class name may change in the future to <code>PointerEvent</code>.
* </p>
* <p>
* http://www.w3.org/Submission/pointer-events/#pointerevent-interface
* </p>
* <a name="coor... | JOGL/jogl-java-src/com/jogamp/newt/event/MouseEvent.java | 0.903926 | 0.41484 | MouseEvent.java | starcoder |
package us.ihmc.humanoidRobotics.footstep;
import java.util.ArrayList;
import us.ihmc.euclid.referenceFrame.FrameConvexPolygon2D;
import us.ihmc.euclid.referenceFrame.FramePoint2D;
import us.ihmc.euclid.referenceFrame.FramePoint3D;
import us.ihmc.euclid.referenceFrame.ReferenceFrame;
import us.ihmc.euclid.referenceFr... | ihmc-humanoid-robotics/src/main/java/us/ihmc/humanoidRobotics/footstep/SimpleFootstepMask.java | 0.703244 | 0.579371 | SimpleFootstepMask.java | starcoder |
package learnrxjava;
import io.reactivex.Maybe;
import io.reactivex.Observable;
import learnrxjava.types.BoxArt;
import learnrxjava.types.JSON;
import learnrxjava.types.Movies;
public class ObservableSolutions {
/**
* Return an Observable that emits a single value "Hello World"
*
* @return "Hello... | src/main/java/learnrxjava/ObservableSolutions.java | 0.886966 | 0.473292 | ObservableSolutions.java | starcoder |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.