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 me.ianaldrighetti.util.collection.graph;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import java.util.HashMap;
import java.util.Set;
/**
* This represents a single vertex (or node) within a {@link Graph}. The vertex stores a value which can... | src/main/java/me/ianaldrighetti/util/collection/graph/Vertex.java | 0.926827 | 0.513668 | Vertex.java | starcoder |
package eden.cpeaii;
import java.awt.*;
import java.awt.geom.*;
public class AsteroidFactory {
// colors
/** Outline color of an Asteroid to be drawn with */
public final static Color OUTLINE = new Color(191, 191, 191);
/** Fill color of an Asteroid to be filled with */
public Color fill;
// boundaries... | src/eden/cpeaii/AsteroidFactory.java | 0.945538 | 0.424949 | AsteroidFactory.java | starcoder |
package hr.fer.zemris.irg.vjezba9.model;
import hr.fer.zemris.irg.vjezba9.linearna.IVector;
import hr.fer.zemris.irg.vjezba9.linearna.Vector;
import java.util.Objects;
public class Vertex3D {
private double x;
private double y;
private double z;
private IVector normal;
public Vertex3D(double x,... | 9vjezba/src/main/java/hr/fer/zemris/irg/vjezba9/model/Vertex3D.java | 0.845592 | 0.559892 | Vertex3D.java | starcoder |
package frc.robot;
import edu.wpi.first.wpilibj.SpeedController;
import edu.wpi.first.wpilibj.Timer;
import frc.robot.sensors.RomiGyro;
/**
* A simulation of the robot's chassis, converting input drive voltages to
* changes to a robot pose
*/
public class SimpleSimulatedChassis {
private RomiGyro m_gyro;
p... | src/main/java/frc/robot/SimpleSimulatedChassis.java | 0.852107 | 0.501404 | SimpleSimulatedChassis.java | starcoder |
package us.ihmc.robotEnvironmentAwareness.slam;
import com.google.common.util.concurrent.AtomicDouble;
import controller_msgs.msg.dds.StereoVisionPointCloudMessage;
import us.ihmc.commons.Conversions;
import us.ihmc.euclid.geometry.interfaces.Pose3DReadOnly;
import us.ihmc.euclid.orientation.interfaces.Orientation3DRe... | robot-environment-awareness/src/main/java/us/ihmc/robotEnvironmentAwareness/slam/SLAMBasics.java | 0.910768 | 0.546496 | SLAMBasics.java | starcoder |
package com.github.texxel.data.serializers;
import com.github.texxel.data.DataConverter;
import com.github.texxel.data.DataIn;
import com.github.texxel.data.DataOut;
public class PrimitiveConverters {
public static class IntegerConverter implements DataConverter<Integer> {
@Override
public void s... | src/main/java/com/github/texxel/data/serializers/PrimitiveConverters.java | 0.92539 | 0.469399 | PrimitiveConverters.java | starcoder |
package algorithms.knn;
import algorithms.model.Model;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import structures.Sample;
import utilities.QuickSelect;
import java.util.ArrayList;
import java.util.List;
/**
* This class implements KNN algorithm that can be used for regression or classification. ... | src/main/java/algorithms/knn/KNearestNeighbors.java | 0.932392 | 0.49292 | KNearestNeighbors.java | starcoder |
package arraylist;
import java.util.Arrays;
import java.util.Stack;
/**
* 84. 柱状图中最大的矩形
* 给定 n 个非负整数,用来表示柱状图中各个柱子的高度。每个柱子彼此相邻,且宽度为 1 。
* 求在该柱状图中,能够勾勒出来的矩形的最大面积。
*/
public class LargestRectangleinHistogram84 {
/**
* 方法一 单调栈
* 枚举高
* 时间复杂度:O(N)。
* 空间复杂度:O(N)。
* @param heights
* @r... | src/main/java/arraylist/LargestRectangleinHistogram84.java | 0.747339 | 0.464051 | LargestRectangleinHistogram84.java | starcoder |
package com.google.gdata.util.common.base;
import java.util.Collection;
import java.util.Objects;
public final class Preconditions {
private Preconditions() {
}
public static void checkArgument(boolean z) {
if (!z) {
throw new IllegalArgumentException();
}
}
public st... | Mobile/cyberpunk2077/src/java/com/google/gdata/util/common/base/Preconditions.java | 0.803945 | 0.460228 | Preconditions.java | starcoder |
package vpc.core.base;
import cck.text.StringUtil;
import cck.util.Util;
import vpc.core.Value;
import vpc.core.decl.Method;
import vpc.core.types.*;
import vpc.util.Cache;
import java.util.List;
/**
* The <code>Function</code> class encapsulates concepts related to functions,
* including typenames for functions, ... | Compiler/src/vpc/core/base/Function.java | 0.846641 | 0.438364 | Function.java | starcoder |
package frc.robot;
import com.revrobotics.CANSparkMax;
import edu.wpi.first.wpilibj.TimedRobot;
import frc.robot.util.DreadbotController;
public class Robot extends TimedRobot {
// This is a reference to a motor controller, which is used to control the robot motor's functions.
// It can do a lot more than we wi... | src/main/java/frc/robot/Robot.java | 0.751101 | 0.474875 | Robot.java | starcoder |
package org.hibernate.validator.internal.engine.resolver;
import java.lang.annotation.ElementType;
import java.util.HashMap;
import java.util.Map;
import javax.validation.Path;
import javax.validation.TraversableResolver;
/**
* Cache results of a delegated traversable resolver to optimize calls.
* It works only for... | engine/src/main/java/org/hibernate/validator/internal/engine/resolver/CachingTraversableResolverForSingleValidation.java | 0.864411 | 0.413596 | CachingTraversableResolverForSingleValidation.java | starcoder |
package com.ptsmods.mysqlw.table;
import com.google.common.collect.ImmutableMap;
import com.ptsmods.mysqlw.Database;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.function.BiFunction;
import java.util.functi... | src/main/java/com/ptsmods/mysqlw/table/ColumnType.java | 0.739893 | 0.404272 | ColumnType.java | starcoder |
package de.bluecolored.bluemap.api;
import com.flowpowered.math.vector.Vector2i;
import com.flowpowered.math.vector.Vector3d;
import com.flowpowered.math.vector.Vector3i;
import java.util.Optional;
import java.util.function.Predicate;
/**
* This class represents a map that is rendered by BlueMap of a specific world... | src/main/java/de/bluecolored/bluemap/api/BlueMapMap.java | 0.922661 | 0.520801 | BlueMapMap.java | starcoder |
* <h1>Non-blocking streaming with netty</h1>
* This document describes the implementation details of streaming protocol. A listener for a streaming
* session listens on the same socket as internode messaging, and participates in the same handshake protocol
* That protocol is described in the package-level documenta... | src/java/org/apache/cassandra/streaming/async/package-info.java | 0.835114 | 0.542076 | package-info.java | starcoder |
package app.roadquality.roadquality.data.entities;
import android.arch.persistence.room.ColumnInfo;
import android.arch.persistence.room.Entity;
import android.arch.persistence.room.PrimaryKey;
import java.util.Map;
import app.roadquality.roadquality.utils.maps.LatLng;
@Entity
public class RoadPoint {
// REQUI... | app/src/main/java/app/roadquality/roadquality/data/entities/RoadPoint.java | 0.668772 | 0.443239 | RoadPoint.java | starcoder |
package de.ddb.pdc.core;
import java.util.NoSuchElementException;
/**
* Interface for a flow chart for calculating the public domain problem.
*/
public interface FlowChartState {
/**
* Get the initial state of the flow chart for the given category of cultural
* good.
*
* @param category The category ... | src/main/java/de/ddb/pdc/core/FlowChartState.java | 0.905613 | 0.4133 | FlowChartState.java | starcoder |
package org.androidtransfuse.util;
import org.apache.commons.lang.StringUtils;
import java.util.Collection;
/**
* @author <NAME>
*/
public final class Contract {
private Contract(){
//private utility constructor
}
/**
* Throw a null pointer exception if object is null
* @param objec... | transfuse-support/src/main/java/org/androidtransfuse/util/Contract.java | 0.939547 | 0.631197 | Contract.java | starcoder |
package co.edu.uniandes.csw.carpooling.ejb;
import co.edu.uniandes.csw.carpooling.entities.PeajeEntity;
import co.edu.uniandes.csw.carpooling.exceptions.BusinessLogicException;
import co.edu.uniandes.csw.carpooling.persistence.PeajePersistence;
import java.util.List;
import java.util.logging.Level;
import java.util.lo... | s4_carpooling-back/src/main/java/co/edu/uniandes/csw/carpooling/ejb/PeajeLogic.java | 0.73029 | 0.411939 | PeajeLogic.java | starcoder |
package codility.challenges;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.IntStream;
/**
* Todo Finish up solution.
*/
public class Germanium {
public static void main(String[] arg... | src/codility/challenges/Germanium.java | 0.799521 | 0.408041 | Germanium.java | starcoder |
package com.github.dm.rf.android.entry;
/**
* Utility class providing helper methods for creating and managing {@link SparseEntry} objects.
* <p/>
* Created by davide-maestroni on 3/18/14.
*/
public class SparseEntries {
/**
* Avoid direct instantiation.
*/
private SparseEntries() {
}
... | library/src/main/java/com/github/dm/rf/android/entry/SparseEntries.java | 0.94996 | 0.481454 | SparseEntries.java | starcoder |
package com.eaglesakura.lib.android.game.math;
import android.annotation.SuppressLint;
/**
*
*
*/
@SuppressLint("FloatMath")
public final class Vector2 {
/**
* X成分。
*/
public float x = 0.0f;
/**
* Y成分。
*/
public float y = 0.0f;
/**
* ゼロ初期化したベクトルを作成する。
*/
publ... | deprecated/eglibrary-android-api8/src/com/eaglesakura/lib/android/game/math/Vector2.java | 0.810179 | 0.408336 | Vector2.java | starcoder |
package net.wytrem.glmario.textures;
import static org.lwjgl.opengl.GL11.GL_NEAREST;
import static org.lwjgl.opengl.GL11.GL_RGBA;
import static org.lwjgl.opengl.GL11.GL_TEXTURE_2D;
import static org.lwjgl.opengl.GL11.GL_TEXTURE_MAG_FILTER;
import static org.lwjgl.opengl.GL11.GL_TEXTURE_MIN_FILTER;
import static org.lw... | src/main/java/net/wytrem/glmario/textures/GlTexture.java | 0.595022 | 0.456046 | GlTexture.java | starcoder |
package com.tomatrocho.game.level.tmx;
/**
* A class for holding information about a particular {@link TMXTile} on a particular {@link TMXLayer}.
*/
public class TMXTile {
/**
* A unique ID given to each {@link TMXTile} of each {@link TMXTileSet} within a TMX file,
* based on the position of the tile ... | Herr-Speck/src/com/tomatrocho/game/level/tmx/TMXTile.java | 0.864009 | 0.464476 | TMXTile.java | starcoder |
package eu.driver.aar.service.objects.fie;
import java.util.ArrayList;
import java.util.List;
public class Rating {
private List<String> comments = new ArrayList<String>();
private List<Integer> effortRating = new ArrayList<Integer>();
private List<Integer> resultRating = new ArrayList<Integer>();
private Dou... | aar-service/src/main/java/eu/driver/aar/service/objects/fie/Rating.java | 0.72487 | 0.430147 | Rating.java | starcoder |
package gov.usgs.earthquake.nshmp;
import static gov.usgs.earthquake.nshmp.data.DoubleData.checkInRange;
import com.google.common.collect.Range;
/**
* Constants and utility methods pertaining to properties of earthquakes.
*
* <p><strong>Note:</strong> The fields and methods of this class that relate to
* earthq... | src/gov/usgs/earthquake/nshmp/Earthquakes.java | 0.939996 | 0.590514 | Earthquakes.java | starcoder |
package com.raytheon.uf.common.dataplugin.gfe.grid;
import java.awt.Point;
import java.nio.FloatBuffer;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
import jep.NDArray;
/**
*
* Implementation of the Float... | edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/grid/Grid2DFloat.java | 0.91734 | 0.540075 | Grid2DFloat.java | starcoder |
package org.ea.javacnn.data;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;
import java.util.Arrays;
import java.util.Random;
import java.io.Serializable;
/**
* Holding all the data handled by the network. So a layer will receive
* this class and return a similar block as a ... | src/org/ea/javacnn/data/DataBlock.java | 0.732209 | 0.419529 | DataBlock.java | starcoder |
package com.search;
import static java.lang.Math.min;
/**
* Fibonacci search is a method of searching a sorted array using a divide and conquer algorithm that narrows down
* possible locations with the aid of Fibonacci numbers. Compared to binary search where the sorted array is divided
* into two equal-sized part... | src/main/java/com/search/FibonacciSearch.java | 0.892108 | 0.554832 | FibonacciSearch.java | starcoder |
package org.nd4j.linalg.api.ops.impl.transforms;
import org.nd4j.linalg.api.complex.IComplexNDArray;
import org.nd4j.linalg.api.complex.IComplexNumber;
import org.nd4j.linalg.api.ndarray.INDArray;
import org.nd4j.linalg.api.ops.BaseTransformOp;
import org.nd4j.linalg.api.ops.Op;
import org.nd4j.linalg.api.ops.Transfor... | nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/ops/impl/transforms/Reverse.java | 0.932982 | 0.495361 | Reverse.java | starcoder |
package gov.usgs.traveltime;
import java.util.logging.Logger;
/**
* Store Earth model data for one wave type. Note that the model is normalized and the depths have
* undergone a flat Earth transformation. Also, only the upper 800 kilometers of the Earth model are
* available here. The reference version contains on... | src/main/java/gov/usgs/traveltime/ModDataVol.java | 0.9455 | 0.594434 | ModDataVol.java | starcoder |
package com.cortex.dane.masymenos.nivel1;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.util.DisplayMetrics;
import com.cortex.dane.masymenos.Recursos;
import com.cortex.dane.masymenos.utils.DaMagicNumber;
public ... | DesafiosMasYMenos/src/com/cortex/dane/masymenos/nivel1/Imagen.java | 0.505127 | 0.405213 | Imagen.java | starcoder |
package com.es.unex.practica_sistemas_inteligentes;
import java.util.Arrays;
import java.util.Random;
/**
* This class defines the structure, properties and methods of the population.
*
* @author eliapacioni
* @version 0.1
*
*/
public class Population {
/**
* General parameters
*/
private Parameters p;
... | src/com/es/unex/practica_sistemas_inteligentes/Population.java | 0.718496 | 0.467028 | Population.java | starcoder |
package se.saidaspen.aoc2019.day12;
import se.saidaspen.aoc2019.Day;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
* Solution to Advent of Code 2019 Day 12
* The original puzzle can be fou... | java/src/main/java/se/saidaspen/aoc2019/day12/Day12.java | 0.892872 | 0.442215 | Day12.java | starcoder |
package com.bbn.openmap.util.stateMachine;
import java.util.Enumeration;
import java.util.Vector;
/**
* The StateMachine lets you organize event handling, if the order of
* the events are important to you. You can use the setState commands
* with the state you want, if you are holding on a copy of it.
* Otherwis... | src/main/java/com/bbn/openmap/util/stateMachine/StateMachine.java | 0.860911 | 0.620593 | StateMachine.java | starcoder |
package uk.ac.derby.ldi.calcast.calculator;
import uk.ac.derby.ldi.calcast.parser.ast.*;
/** A new AST-based calculator. */
public class Parser implements CalcVisitor {
// Execute a given child of the given node
private Object doChild(SimpleNode node, int childIndex, Object data) {
return node.jjtGetCh... | CalcAST/src/uk/ac/derby/ldi/calcast/calculator/Parser.java | 0.640861 | 0.524821 | Parser.java | starcoder |
class Solution {
// O(n) time O(n) space
public int maxProfit(int[] prices) {
int n = prices.length;
if (n < 2) return 0;
int[] leftProfit = new int[n];
int[] rightProfit = new int[n + 1];
int leftMin = prices[0];
int rightMax = prices[n - 1];
for (int l =... | dynamicProgramming/bestTimeToBuyAndSellStock.java/123_BuyAndSellStock3.java | 0.798147 | 0.4953 | 123_BuyAndSellStock3.java | starcoder |
public class Enigma {
private Wheel A;
private Wheel B;
private Wheel C;
private Reflector ref;
private final static boolean DEBUG = false;
// The wiring of the eight original Enigma wheels I - VIII
private String wheels[] = {
"EKMFLGDQVZNTOWYHXUSPAIBRCJ",
"AJDKSIRUXBLHWTMCQGZNPYFVOE",
"... | projects/benchmarks/enigma/Enigma.java | 0.504883 | 0.527256 | Enigma.java | starcoder |
package jpaul.Graphs;
import java.util.List;
import java.util.LinkedList;
import java.util.Collection;
import java.util.Map;
import java.util.LinkedHashMap;
import jpaul.DataStructs.Pair;
import jpaul.DataStructs.DSUtil;
import jpaul.DataStructs.Relation;
import jpaul.DataStructs.MapSetRelation;
import jpaul.Misc.Fu... | src/main/java/jpaul/Graphs/LabeledDiGraph.java | 0.831246 | 0.535038 | LabeledDiGraph.java | starcoder |
package com.zhangxx.java8.leetcode;
public class Solution3 {
/**
* 35. 搜索插入位置
* 给定一个排序数组和一个目标值,在数组中找到目标值,并返回其索引。如果目标值不存在于数组中,返回它将会被按顺序插入的位置。
* <p>
* 你可以假设数组中无重复元素。
* <p>
* 示例 1:
* <p>
* 输入: [1,3,5,6], 5
* 输出: 2
* 示例 2:
* <p>
* 输入: [1,3,5,6], 2
* 输出: 1
* 示例 3:
* <p>
*... | src/main/java/com/zhangxx/java8/leetcode/Solution3.java | 0.674801 | 0.437944 | Solution3.java | starcoder |
package Ex1;
import java.util.Iterator;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Iterator;
import java.util.function.Predicate;
import Ex1.Monom;
/**
* This class represents a Polynom with add, multiply functionality, it also
* should support the following: 1. Riemann's Integral... | Ex1/Polynom.java | 0.55941 | 0.420957 | Polynom.java | starcoder |
* @author <NAME>
* @version $Revision$
*/
package awt.java.awt.geom;
/**
* The Interface PathIterator represents an iterator object that can be used to
* traverse the outline of a {@link java.awt.Shape}. It returns points along the
* boundary of the Shape which may be actual vertices (in the case of a shape
* ... | src/awt/java/awt/geom/PathIterator.java | 0.940688 | 0.700946 | PathIterator.java | starcoder |
package org.meeuw.math.uncertainnumbers.field;
import lombok.Getter;
import org.meeuw.math.Utils;
import org.meeuw.math.exceptions.DivisionByZeroException;
import org.meeuw.math.numbers.DoubleOperations;
import org.meeuw.math.numbers.UncertaintyNumberOperations;
import org.meeuw.math.text.spi.FormatService;
import or... | mihxil-math/src/main/java/org/meeuw/math/uncertainnumbers/field/UncertainDoubleElement.java | 0.935847 | 0.40539 | UncertainDoubleElement.java | starcoder |
package gov.sandia.cognition.learning.algorithm.regression;
import gov.sandia.cognition.evaluator.Evaluator;
import gov.sandia.cognition.learning.data.DefaultInputOutputPair;
import gov.sandia.cognition.learning.function.kernel.Kernel;
import gov.sandia.cognition.learning.function.kernel.LinearKernel;
import gov.sandi... | Components/LearningCore/Test/gov/sandia/cognition/learning/algorithm/regression/KernelBasedIterativeRegressionTest.java | 0.851645 | 0.758287 | KernelBasedIterativeRegressionTest.java | starcoder |
package loon.action.collision;
import loon.canvas.Image;
import loon.canvas.LColor;
import loon.geom.BoxSize;
import loon.geom.Line;
import loon.geom.Point;
import loon.geom.RectBox;
import loon.geom.Shape;
import loon.geom.ShapeUtils;
import loon.geom.Vector2f;
import loon.geom.Vector3f;
import loon.geom.XY;
import l... | Java/Loon-Neo/src/loon/action/collision/CollisionHelper.java | 0.646237 | 0.50415 | CollisionHelper.java | starcoder |
package com.gempukku.libgdx.graph.util.particles;
import com.badlogic.gdx.graphics.Camera;
import com.badlogic.gdx.math.Vector3;
import com.badlogic.gdx.utils.ObjectMap;
import com.gempukku.libgdx.graph.pipeline.producer.rendering.producer.WritablePropertyContainer;
import com.gempukku.libgdx.graph.plugin.particles.Gr... | gdx-graph-util/src/com/gempukku/libgdx/graph/util/particles/CommonPropertiesParticleEffectAdapter.java | 0.874681 | 0.447581 | CommonPropertiesParticleEffectAdapter.java | starcoder |
package org.simpleframework.xml.core;
import java.lang.annotation.Annotation;
import java.lang.reflect.Constructor;
/**
* The <code>ParameterContact</code> object is used to represent
* a contact that is provided so that a <code>Label</code> can be
* used to determine a consistent name for the parameter. Unlike
*... | CloudyMail/lib_src/org/simpleframework/xml/core/ParameterContact.java | 0.925103 | 0.459561 | ParameterContact.java | starcoder |
package telekit.base.util;
public final class NumberUtils {
public static boolean isOdd(int value) {
return (value & 1) != 0;
}
public static boolean isEven(int value) {
return (value % 2) == 0;
}
public static boolean isBetween(int value, int minInclusive, int maxInclusive) {
... | telekit-base/src/main/java/telekit/base/util/NumberUtils.java | 0.922062 | 0.602909 | NumberUtils.java | starcoder |
package edu.umn.biomedicus.uima.copying;
import java.util.ArrayDeque;
import java.util.Deque;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import org.apache.uima.cas.CAS;
import org.apache.uima.cas.FeatureStructure;
/**
* Responsible for copying the FeatureStructures of one UIMA CAS view... | biomedicus-uima/src/main/java/edu/umn/biomedicus/uima/copying/FeatureStructureCopyingQueue.java | 0.920361 | 0.405802 | FeatureStructureCopyingQueue.java | starcoder |
package org.cesiumjs.cs.core;
import jsinterop.annotations.JsConstructor;
import jsinterop.annotations.JsMethod;
import jsinterop.annotations.JsProperty;
import jsinterop.annotations.JsType;
import org.cesiumjs.cs.core.enums.Intersect;
/**
* @author <NAME> aka iSergio
*/
@JsType(isNative = true, namespace = "Cesium... | cesiumjs4gwt-main/src/main/java/org/cesiumjs/cs/core/BoundingSphere.java | 0.931353 | 0.643077 | BoundingSphere.java | starcoder |
package ca.waterloo.dsg.graphflow.plan.operator.extend;
import ca.waterloo.dsg.graphflow.datachunk.vectors.adjcols.VectorAdjCols;
import ca.waterloo.dsg.graphflow.datachunk.vectors.adjcols.VectorAdjCols.VectorAdjColsCopied;
import ca.waterloo.dsg.graphflow.datachunk.vectors.property.Vector;
import ca.waterloo.dsg.grap... | GF-CL/src/main/java/ca/waterloo/dsg/graphflow/plan/operator/extend/ExtendColumn.java | 0.685739 | 0.435301 | ExtendColumn.java | starcoder |
package org.firstinspires.ftc.teamcode;
public class RoboPoint extends Point {
private static final double MINIMUM_DISTANCE_AWAY = 1; // Minimum distance away from point to move
private static final double MINIMUM_ANGLE_AWAY = 1;
private static final double DISTANCE_BETWEEN_WHEELS = 15;
private static... | TeamCode/src/main/java/org/firstinspires/ftc/teamcode/RoboPoint.java | 0.917485 | 0.561636 | RoboPoint.java | starcoder |
package com.omega.amazehing.game.ai.steering;
import com.badlogic.gdx.ai.steer.Steerable;
import com.badlogic.gdx.ai.steer.SteeringBehavior;
import com.badlogic.gdx.math.Vector2;
import com.omega.amazehing.game.ai.steering.debug.Debuggable;
public abstract class AbstractSteeringAgent implements Debuggable, Steerable<... | core/src/com/omega/amazehing/game/ai/steering/AbstractSteeringAgent.java | 0.933249 | 0.449393 | AbstractSteeringAgent.java | starcoder |
package org.jamocha.rete;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Map;
import java.util.Iterator;
/**
* @author <NAME>
*
* TemporalHashedAlphaMem is the hashed alpha memory for Temporal nodes.
* We use a linkedHashMap so that we can easily remove the expired facts.
* This means ... | src/main/org/jamocha/rete/TemporalHashedAlphaMem.java | 0.816845 | 0.477067 | TemporalHashedAlphaMem.java | starcoder |
package slbh.scene;
import java.util.Iterator;
import java.util.Vector;
public class Scene {
private Vector<Vector<SceneObject>> floors;
public int startPosition[] = new int[3];
private double deltaXY = 2;
private double deltaZ = 3;
private int repeat = 1;
public Scene() {
clearScene... | SecondLifeBuilerHelper/src/main/java/slbh/scene/Scene.java | 0.815159 | 0.544499 | Scene.java | starcoder |
package us.ihmc.euclid.shape.primitives.interfaces;
import us.ihmc.euclid.Axis3D;
import us.ihmc.euclid.transform.interfaces.Transform;
import us.ihmc.euclid.tuple3D.interfaces.Point3DBasics;
import us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly;
import us.ihmc.euclid.tuple3D.interfaces.UnitVector3DBasics;
import u... | src/shape/java/us/ihmc/euclid/shape/primitives/interfaces/Torus3DBasics.java | 0.959097 | 0.54353 | Torus3DBasics.java | starcoder |
package org.mechio.api.interpolation.cspline;
import java.awt.geom.Point2D;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import org.jflux.api.common.rk.config.VersionProperty;
import org.mechio.api.interpolation.Interpolator;
/**
* Implementation of a Catmull-Rom Cardinal Spline us... | maven/projects/org.mechio.api.animation/src/main/java/org/mechio/api/interpolation/cspline/CSplineInterpolator.java | 0.869452 | 0.413892 | CSplineInterpolator.java | starcoder |
package uk.ac.sussex.gdsc.core.utils;
import java.io.Serializable;
import java.util.Comparator;
/**
* Provides number sensitive sorting for character sequences.
*
* <p>Extracts sub-sequences of either numeric ({@code [0, 9]}) or non-numeric characters and
* compares them numerically or lexicographically. Leading ... | gdsc-core/src/main/java/uk/ac/sussex/gdsc/core/utils/AlphaNumericComparator.java | 0.949271 | 0.412826 | AlphaNumericComparator.java | starcoder |
package science.atlarge.granula.modeller.platform.visual;
import science.atlarge.granula.modeller.entity.Archivable;
import science.atlarge.granula.modeller.entity.BasicType;
import science.atlarge.granula.modeller.platform.info.Info;
import science.atlarge.granula.modeller.platform.info.InfoSource;
import science.atl... | granula-modeller/src/main/java/science/atlarge/granula/modeller/platform/visual/TimeSeriesVisual.java | 0.772874 | 0.476519 | TimeSeriesVisual.java | starcoder |
package org.gradoop.flink.model.api.epgm;
import org.apache.flink.api.java.DataSet;
import org.gradoop.common.model.impl.pojo.Edge;
import org.gradoop.common.model.impl.pojo.GraphHead;
import org.gradoop.common.model.impl.pojo.Vertex;
import org.gradoop.flink.model.api.layouts.LogicalGraphLayoutFactory;
import org.gra... | gradoop-flink/src/main/java/org/gradoop/flink/model/api/epgm/LogicalGraphFactory.java | 0.931416 | 0.445168 | LogicalGraphFactory.java | starcoder |
package uk.ac.ed.inf.graph.compound.newimpl;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.jmock.Mockery;
import org.jmock.integration.junit4.JMock;
import org.jmock.integration.junit4.JUnit4Mockery;
import org.junit.Afte... | test/uk/ac/ed/inf/graph/compound/newimpl/CompoundNodeRemovedStateTest.java | 0.804751 | 0.445771 | CompoundNodeRemovedStateTest.java | starcoder |
package aquarius;
import aquarius.action.PredictiveAction;
import aquarius.expression.*;
import aquarius.misc.Tuple2;
import aquarius.misc.Tuple3;
import aquarius.misc.Tuple4;
import aquarius.misc.Tuple5;
/**
* helper methods for parsing expression construction
*
* @author skgchxngsxyz-opensuse
*/
public final cl... | aquarius-core/src/main/java/aquarius/Expressions.java | 0.848125 | 0.438244 | Expressions.java | starcoder |
package edu.stanford.nlp.loglinear.model;
import java.io.BufferedWriter;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
/**
* Created on 10/20/15.
* @author keenon
* <p>
* This is a wrapper function to keep a namespace of namespace of recognized features, so that building a set of
* ... | CoreNLP/src/edu/stanford/nlp/loglinear/model/ConcatVectorNamespace.java | 0.920495 | 0.665733 | ConcatVectorNamespace.java | starcoder |
package edu.ncsu.csc.Galant.graph.component;
import java.util.ArrayList;
import edu.ncsu.csc.Galant.logging.LogHelper;
class LayerInformation {
int numberOfLayers;
/**
* Stores the number of nodes on each layer
*/
ArrayList<Integer> layerSize;
/**
* Stores the maximum position of a node on each ... | src/edu/ncsu/csc/Galant/graph/component/LayerInformation.java | 0.643217 | 0.444987 | LayerInformation.java | starcoder |
package ch.epfl.rigel.gui;
import ch.epfl.rigel.coordinates.GeographicCoordinates;
import javafx.beans.binding.Bindings;
import javafx.beans.binding.ObjectBinding;
import javafx.beans.property.DoubleProperty;
import javafx.beans.property.SimpleDoubleProperty;
/**
* Class containing the position of the observer
*
*... | src/ch/epfl/rigel/gui/ObserverLocationBean.java | 0.952794 | 0.491944 | ObserverLocationBean.java | starcoder |
package org.znerd.math;
import java.math.*;
/**
* Implementation of an <code>IntegerNumber</code> based on a
* <code>int</code> value.
*
* <p />Instances must be obtained by using one of the
* <code>createInstance()</code> factory methods. Using this approach,
* instances can be transparently cached by this cla... | src/main/org/znerd/math/SmallIntegerNumber.java | 0.93393 | 0.485295 | SmallIntegerNumber.java | starcoder |
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.PriorityQueue;
import java.util.List;
/**
* BnBSolver for the Bears and Beds problem. Each Bear can only be compared to Bed objects and each Bed
* can only be compared to Bear objects. There is a one-to-one mappin... | lab/clab11/BnBSolver.java | 0.846736 | 0.572424 | BnBSolver.java | starcoder |
package de.topocare.topocareXiota.iotaMachineWallet.pools;
import static de.topocare.topocareXiota.iotaMachineWallet.IotaConfig.productionUnitSize;
import java.util.ArrayList;
import java.util.List;
import java.util.ListIterator;
import de.topocare.topocareXiota.iotaMachineWallet.address.IotaAddress;
import de.topoc... | src/de/topocare/topocareXiota/iotaMachineWallet/pools/IotaAddressPool.java | 0.748536 | 0.479504 | IotaAddressPool.java | starcoder |
package msa.lang.autocompute.ds;
import msa.lang.autocompute.algorithm.TarjanStrongConnectivityInspector;
import java.util.*;
public class DirectedGraph<V> implements Graph<V> {
protected Map<V, Set<V>> adj;
protected V origin;
private final TarjanStrongConnectivityInspector<V> strongConnectivityIns... | src/main/java/msa/lang/autocompute/ds/DirectedGraph.java | 0.925023 | 0.415729 | DirectedGraph.java | starcoder |
package nl.tudelft.context.cg2.client.controller.io.posedetection;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
/**
* Class representing the pose of a human body.
*/
public class Pose {
private Position leftArm;
private Position rightArm;
private Position leftLeg;
privat... | client/src/main/java/nl/tudelft/context/cg2/client/controller/io/posedetection/Pose.java | 0.965389 | 0.492676 | Pose.java | starcoder |
package com.jacobgen.microsoft.msword;
import com.jacob.com.*;
public class CoAuthoring extends Dispatch {
public static final String componentName = "Word.CoAuthoring";
public CoAuthoring() {
super(componentName);
}
/**
* This constructor is used instead of a case operation to
* turn a Dispatch object int... | myffmpeg-java20140728/MySpeech/gensrc/com/jacobgen/microsoft/msword/CoAuthoring.java | 0.826957 | 0.44089 | CoAuthoring.java | starcoder |
package org.apache.reef.util;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.ReentrantLock;
/**
* Manages Java lock and condition objects to create a simplified
* condition variable interface.
*/
public final class ComplexCondition {
private f... | lang/java/reef-utils/src/main/java/org/apache/reef/util/ComplexCondition.java | 0.902653 | 0.403743 | ComplexCondition.java | starcoder |
package util;
import model.LineInterface;
import model.Point;
import model.Polygon;
import model.VerticalLine;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
* A class for various mathematical functions.
*/
public class MathUtils {
public static final fl... | src/main/java/util/MathUtils.java | 0.915233 | 0.538012 | MathUtils.java | starcoder |
package org.neo4j.driver.v1;
import java.util.List;
import java.util.Map;
/**
* Represents a value from Neo4j.
*
* This interface describes a number of <code>isType</code> methods along with
* <code>typeValue</code> methods. The first set of these correlate with types from
* the Neo4j Type System and are used to... | driver/src/main/java/org/neo4j/driver/v1/Value.java | 0.948202 | 0.57827 | Value.java | starcoder |
package pl.edu.pw.mini.mg1.models;
import com.jogamp.opengl.GL4;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.tuple.Triple;
import org.joml.*;
import pl.edu.pw.mini.mg1.cameras.PerspectiveCamera;
import pl.edu.pw.mini.mg1.graphics.Renderer;
import pl.edu.pw.mini.mg1.graphics.Texture;
imp... | src/main/java/pl/edu/pw/mini/mg1/models/MilledBlock.java | 0.856377 | 0.595463 | MilledBlock.java | starcoder |
package cern.extjfx.chart.data;
import java.util.Arrays;
/**
* Utility methods related to chart data.
*/
public final class DataUtils {
private DataUtils() {
// No instances
}
/**
* Returns insertion index of specified X coordinate within given chart data.
*
* @pa... | extjfx-chart/src/main/java/cern/extjfx/chart/data/DataUtils.java | 0.93003 | 0.537527 | DataUtils.java | starcoder |
package io.molr.commons.domain.dto;
import static java.util.Collections.emptyMap;
import static java.util.Collections.emptySet;
import static java.util.Optional.ofNullable;
import static java.util.stream.Collectors.toList;
import static java.util.stream.Collectors.toMap;
import static java.util.stream.Collectors.toSet... | molr-commons/src/main/java/io/molr/commons/domain/dto/MissionStateDto.java | 0.762866 | 0.419945 | MissionStateDto.java | starcoder |
package geocode;
import static java.lang.Math.atan2;
import static java.lang.Math.cos;
import static java.lang.Math.sin;
import static java.lang.Math.sqrt;
import static java.lang.Math.toRadians;
import geocode.kdtree.KDNodeComparator;
import java.util.Comparator;
/**
* This class works with a postal code file fro... | src/main/java/geocode/PostalCode.java | 0.916769 | 0.592549 | PostalCode.java | starcoder |
package dp.partitionEqualSubsetSum;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.Before;
import org.junit.Test;
/**
* @author ramamurthy
*
*/
public class DP_Bottom_Up {
static int COUNTER = 0;
public boolean canPartition(int[] nums) {
int totalSum ... | Java_Problem_Solving/src/dp/partitionEqualSubsetSum/DP_Bottom_Up.java | 0.635788 | 0.437523 | DP_Bottom_Up.java | starcoder |
package com.google.engedu.bstguesser;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
public class TreeNode {
private static final int SIZE = 60;
private static final int MARGIN = 20;
private int value, height;
protected TreeNode left, right;
private b... | Android/Google-Applied-CS-Skills/BSTGuesser/app/src/main/java/com/google/engedu/bstguesser/TreeNode.java | 0.961389 | 0.61832 | TreeNode.java | starcoder |
package com.computation.common.concurrent.search;
import com.computation.common.Point2D;
import com.computation.common.Reference;
import com.computation.common.Utils;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutorService;
/**
* Created by mwkurian on 11/19/2014.
*/
public c... | Parallel Convex Hull/src/com/computation/common/concurrent/search/ForkedPointLeftOf.java | 0.861378 | 0.471223 | ForkedPointLeftOf.java | starcoder |
package com.advent.day3;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Map;
import java.util.Scanner;
public class Spiral {
private static int CLOCKWISE = 1;
private static int COUNTERCLOCKWISE = -1;
private Vector initialVector;
private Map<String,String> move... | 2017/day3/src/com/advent/day3/Spiral.java | 0.781706 | 0.64572 | Spiral.java | starcoder |
package io.sf.carte.doc.style.css.parser;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import java.io.IOException;
import java.io.StringReader... | junit/io/sf/carte/doc/style/css/parser/DeclarationParserTest.java | 0.824214 | 0.472501 | DeclarationParserTest.java | starcoder |
package DiverseString;
import java.util.Arrays;
import java.util.Scanner;
/*
* Given letters A, B, and C, print a diverse string. A diverse string is one is which no 3 distinct
* characters are consecutive. Input consists of counts for each letter A, B, and C.
* Output a diverse string which satisfies the above co... | src/DiverseString/Naive.java | 0.755547 | 0.423279 | Naive.java | starcoder |
* @author <NAME>
* @version 0.1.0
*/
package fr.ubordeaux.ddd.plugin.fixes;
import java.util.HashMap;
import java.util.Map;
import fr.ubordeaux.ddd.plugin.syntax.Syntax;
public final class QuickFixSelector {
private final Syntax syntax;
private final Map<String, QuickFix[]> sets;
public QuickFixSele... | buildSrc/src/main/java/fr/ubordeaux/ddd/plugin/fixes/QuickFixSelector.java | 0.757436 | 0.437283 | QuickFixSelector.java | starcoder |
package xal.tools.math.rn;
import xal.tools.data.DataAdaptor;
import xal.tools.math.BaseVector;
/**
* Represents a vector of real numbers with arbitrary length.
*
* @author <NAME>
* @since Jul 22, 2015
*/
public class Rn extends BaseVector<Rn> {
/*
* Global Constants
*/
/** Serializ... | core/src/xal/tools/math/rn/Rn.java | 0.918206 | 0.465691 | Rn.java | starcoder |
package com.organization.commons.base;
import java.util.Arrays;
public class ByteUtils {
/* ---------------------------------------
BASE
--------------------------------------- */
public static byte[] concatenateArrays(byte[] first, byte[]... remaining) {
int len = first.length;
... | main/core/modules/commons/src/java/com/organization/commons/base/ByteUtils.java | 0.848753 | 0.491883 | ByteUtils.java | starcoder |
package tyvrel.mag.core.factory.longitudinalreinforcement;
import tyvrel.mag.core.exception.CompressionTooHighException;
import tyvrel.mag.core.exception.HeightTooSmallException;
import tyvrel.mag.core.exception.ImproperDataException;
import tyvrel.mag.core.exception.LSException;
import tyvrel.mag.core.factory.Factory... | src/main/java/tyvrel/mag/core/factory/longitudinalreinforcement/LongitudinalReinforcementFactory.java | 0.853257 | 0.420124 | LongitudinalReinforcementFactory.java | starcoder |
package com.oregonscientific.meep.util;
import java.lang.reflect.GenericArrayType;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.lang.reflect.WildcardType;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import com.google.gson.internal.$Gson$Typ... | meep/Meep/src/com/oregonscientific/meep/util/Iterables.java | 0.851212 | 0.403479 | Iterables.java | starcoder |
package org.aion.types;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import org.junit.Assert;
import org.junit.Test;
public class AddressTest {
@Test(expected = NullPointerException.class)
public void testNull... | test/org/aion/types/AddressTest.java | 0.914331 | 0.746139 | AddressTest.java | starcoder |
package com.dfsek.terra.api.util;
import net.jafama.FastMath;
import java.util.List;
/**
* Utility class for mathematical functions.
*/
public final class MathUtil {
/**
* Epsilon for fuzzy floating point comparisons.
*/
public static final double EPSILON = 1.0E-5;
/**
* Gets the s... | common/api/src/main/java/com/dfsek/terra/api/util/MathUtil.java | 0.880829 | 0.496643 | MathUtil.java | starcoder |
package jsl.utilities.statistic;
import java.util.Arrays;
import java.util.Objects;
import jsl.utilities.distributions.Normal;
import jsl.utilities.distributions.StudentT;
/**
* The Statistic class allows the collection of summary statistics on data via
* the collect() methods. The primary statistical summary is ... | JSLCore/src/main/java/jsl/utilities/statistic/Statistic.java | 0.916539 | 0.592637 | Statistic.java | starcoder |
package org.opensourcephysics.display2d;
/**
* Title: TestData
* Description: Static methods to generate test data for various programs.
* Copyright: Copyright (c) 2005 <NAME>, and Tobochnik
* @author <NAME>
* @version 1.0
*/
public class TestData {
/**
* Dipole distribution wit... | workspace_compadre/osp/src/org/opensourcephysics/display2d/TestData.java | 0.76207 | 0.562477 | TestData.java | starcoder |
package ffx.algorithms;
import ffx.potential.bonded.Atom;
import java.util.logging.Logger;
/**
*
* @author MPbenowitz
*/
// WARNING! The system's center of mass must be set to zero for each timestep!
public class GyrationRadius {
private static final Logger logger = Logger.getLogger(GyrationRadius.class.getNa... | GyrationRadius.java | 0.85081 | 0.454048 | GyrationRadius.java | starcoder |
package chapter4;
import javabayes.Helpers.BayesNetHelper;
import javabayes.InferenceGraphs.InferenceGraph;
import javabayes.InferenceGraphs.InferenceGraphNode;
/**
* Created by Steve on 6/7/2015.
*/
public class BayesNetExample {
public BayesNetExample() {
InferenceGraph inferenceGraph = new Inference... | src/chapter4/BayesNetExample.java | 0.620966 | 0.40589 | BayesNetExample.java | starcoder |
import static org.junit.jupiter.api.Assertions.*;
import java.util.ArrayList;
import org.junit.jupiter.api.Test;
class RuleTest {
ArrayList<Rule> testSetOfRules;
Rule ruleB1;
Rule ruleB1bis;
Rule ruleE1;
Rule ruleE1inv;
Rule ruleB2;
Rule ruleB3;
Rule ruleMA;
Rule ruleNoShares;
... | src/RuleTest.java | 0.681939 | 0.452052 | RuleTest.java | starcoder |
import java.util.Scanner;
public class MyMain {
// Calculates the median of the three inputs
public static int median(int a, int b, int c) {
if (a >= b && a >= c) {
if (b >= c) {
return b;
} else {
return c;
}
} else if (b >= ... | src/main/java/MyMain.java | 0.720073 | 0.583352 | MyMain.java | starcoder |
package dk.sebsa.amber.math;
import java.util.List;
public class Vector2f {
public float x;
public float y;
public Vector2f(Vector2f v) { x = v.x; y = v.y; }
public Vector2f(float x, float y) {
this.x = x;
this.y = y;
}
public Vector2f() {
this.x = 0;
this.y = 0;
}
public void zero() {
this.x ... | src/main/java/dk/sebsa/amber/math/Vector2f.java | 0.733165 | 0.793146 | Vector2f.java | starcoder |
package com.b.c.f;
import java.util.HashMap;
public class b
extends com.b.c.b
{
protected static final HashMap<Integer, String> e = new HashMap();
static
{
e.put(Integer.valueOf(0), "Profile Size");
e.put(Integer.valueOf(4), "CMM Type");
e.put(Integer.valueOf(8), "Version");
e.put(Integer.v... | java/classes/com/b/c/f/b.java | 0.841891 | 0.46041 | b.java | starcoder |
package com.ruszki.leetcode.aodp;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.Queue;
class Solution {
// This solution first sort the array, then goes through on it in ascending order. The smallest element will be
// the smallest member of a pair. The other member of the pai... | monthly-challenges/2021-08/11-array-of-doubled-pairs/src/main/java/com/ruszki/leetcode/aodp/Solution.java | 0.829492 | 0.464962 | Solution.java | starcoder |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.