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 eisenwave.torrens.object;
import java.io.Serializable;
import java.util.Arrays;
/**
* An immutable triplet of integer coordinates.
*/
public class Vertex3i implements Serializable {
@SuppressWarnings("unused")
public final static Vertex3i ZERO = new Vertex3i(0, 0, 0);
private final int x, y, z... | torrens-core/src/main/java/eisenwave/torrens/object/Vertex3i.java | 0.926533 | 0.471527 | Vertex3i.java | starcoder |
package org.apache.hadoop.hive.ql.exec.vector.expressions;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import org.apache.commons.lang.StringUtils;
import org.apache.hadoop.hive.ql.exec.vector.BytesColumnVector;
import org.apache.hadoop.hive.ql.exec.vector.VectorExpressionDescriptor;
import org.... | ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/StringSubstrColStart.java | 0.733547 | 0.578031 | StringSubstrColStart.java | starcoder |
package com.ra4king.opengl.util.math;
import java.nio.FloatBuffer;
import org.lwjgl.BufferUtils;
public class Vector3 implements Vector<Vector3> {
private float x, y, z;
public Vector3() {
set(0, 0, 0);
}
public Vector3(float v) {
this(v, v, v);
}
public Vector3(float x, float y, flo... | src/com/ra4king/opengl/util/math/Vector3.java | 0.863276 | 0.575886 | Vector3.java | starcoder |
package org.jau.lang;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
public class StructAccessor {
private final ByteBuffer bb;
public StructAccessor(final ByteBuffer bb) {
// Setting of byte order is concession to native code which needs
// to instantiate these
this.bb = bb.... | java_base/org/jau/lang/StructAccessor.java | 0.914386 | 0.531088 | StructAccessor.java | starcoder |
package org.apache.sis.internal.referencing.provider;
import javax.measure.Unit;
import javax.measure.quantity.Length;
import org.opengis.util.FactoryException;
import org.opengis.parameter.ParameterValue;
import org.opengis.parameter.ParameterValueGroup;
import org.opengis.parameter.ParameterDescriptor;
import org.op... | core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeographicToGeocentric.java | 0.900883 | 0.444866 | GeographicToGeocentric.java | starcoder |
package com.shenjiahuan.task4;
import java.util.Collection;
import java.util.Iterator;
import java.util.NoSuchElementException;
import java.util.concurrent.BlockingDeque;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.TimeUnit;
public final cla... | Task_4/src/main/java/com/shenjiahuan/task4/BlockingTwoWayQueue.java | 0.904269 | 0.477737 | BlockingTwoWayQueue.java | starcoder |
import java.util.Scanner;
public class Exercise6_39 {
/** Main method */
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
// Prompt the user to enter the three points for p0, p1 and p2
System.out.print("Enter the three points for p0, p1, and p2 : ");
double x0 = input.nextDou... | Chapter6/src/Exercise6_39.java | 0.542136 | 0.606528 | Exercise6_39.java | starcoder |
package com.jrefinery.chart;
import java.awt.*;
import java.awt.geom.*;
import java.util.*;
import com.jrefinery.data.*;
import com.jrefinery.chart.event.*;
/**
* A general class for plotting vertical bars with a 3D effect, using data from any class that
* implements the CategoryDataset interface.
* <P>
* This cl... | code_comments_coherence/media/jfreechart/0.6.0/jfreechart-060zip/extracted/jfreechart-0.6.0/source/com/jrefinery/chart/VerticalBarPlot3D.java | 0.924279 | 0.535645 | VerticalBarPlot3D.java | starcoder |
package com.opengamma.analytics.financial.provider.calculator.discounting;
import com.opengamma.analytics.financial.interestrate.InstrumentDerivativeVisitorAdapter;
import com.opengamma.analytics.financial.interestrate.annuity.derivative.Annuity;
import com.opengamma.analytics.financial.interestrate.annuity.derivative... | projects/OG-Analytics/src/main/java/com/opengamma/analytics/financial/provider/calculator/discounting/PresentValueCurveSensitivityDiscounting2Calculator.java | 0.922696 | 0.563138 | PresentValueCurveSensitivityDiscounting2Calculator.java | starcoder |
package data;
import java.io.Serializable;
import java.util.Vector;
import element.Element;
import node.Node;
/**
* Class for storing Group model information.
*
* @author Murat
*
*/
public class Group implements Serializable {
private static final long serialVersionUID = 1L;
/** The name of group. */
priva... | src-gui/data/Group.java | 0.93154 | 0.521045 | Group.java | starcoder |
package us.ihmc.simulationconstructionset;
import java.util.ArrayList;
import java.util.Random;
import javax.vecmath.AxisAngle4d;
import javax.vecmath.Tuple2d;
import javax.vecmath.Tuple3d;
import javax.vecmath.Vector3d;
import us.ihmc.graphicsDescription.Graphics3DObject;
import us.ihmc.graphicsDescription.appearan... | SimulationConstructionSet/src/us/ihmc/simulationconstructionset/RandomRobotGenerator.java | 0.736401 | 0.532121 | RandomRobotGenerator.java | starcoder |
package org.apache.spark.sql.catalyst.expressions;
/**
* An expression that produces zero or more rows given a single input row.
* <p>
* Generators produce multiple output rows instead of a single value like other expressions,
* and thus they must have a schema to associate with the rows that are output.
* <p>
* ... | sql/catalyst/target/java/org/apache/spark/sql/catalyst/expressions/Generator.java | 0.887796 | 0.578002 | Generator.java | starcoder |
package org.apache.woden.xpointer;
import org.apache.woden.types.NCName;
import java.util.List;
import java.util.ArrayList;
import java.util.Iterator;
import java.lang.StringBuffer;
import java.lang.NumberFormatException;
/**
* ElementPointerPart is a class which represents the element() scheme for the XPointer Fr... | src/org/apache/woden/xpointer/ElementPointerPart.java | 0.85817 | 0.420183 | ElementPointerPart.java | starcoder |
package cn.lambdalib2.util;
import org.lwjgl.util.Color;
import static org.lwjgl.opengl.GL11.glColor4ub;
public final class Colors {
public static Color white() {
return new Color(255, 255, 255, 255);
}
public static Color black() {
return new Color(0, 0, 0, 255);
}
public stat... | src/main/java/cn/lambdalib2/util/Colors.java | 0.868743 | 0.459804 | Colors.java | starcoder |
package br.com.correios.bsb.sigep.master.bean.cliente;
public class CartaoPostagemERP implements java.io.Serializable {
private java.lang.String codigoAdministrativo;
private br.com.correios.bsb.sigep.master.bean.cliente.ContratoERP[] contratos;
private java.util.Calendar dataAtualizacao;
private j... | src/main/java/br/com/correios/bsb/sigep/master/bean/cliente/CartaoPostagemERP.java | 0.631026 | 0.580233 | CartaoPostagemERP.java | starcoder |
package DsAlgoMadeEasyInJava.Graph;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Stack;
public class GraphUsingGrid {
private final int vertices;
private int[][] graph;
private GraphUsingGrid(int vertices) {
this.vertices = vertices;
graph = new int[vertices][vertices];
}
... | DsAlgoMadeEasyInJava/Graph/GraphUsingGrid.java | 0.786172 | 0.590779 | GraphUsingGrid.java | starcoder |
package com.opengamma.analytics.financial.credit.recoveryratemodel;
import org.apache.commons.math.distribution.BetaDistributionImpl;
/**
* Class to specify a stochastic recovery rate model to tag to a given obligor/trade.
*/
public class RecoveryRateModelStochastic extends RecoveryRateModel {
// ---------------... | projects/analytics/src/main/java/com/opengamma/analytics/financial/credit/recoveryratemodel/RecoveryRateModelStochastic.java | 0.530236 | 0.478224 | RecoveryRateModelStochastic.java | starcoder |
package sun.nio.fs;
import java.nio.file.InvalidPathException;
/**
* A parser of Windows path strings
*/
// windows่ทฏๅพ่งฃๆๅจ
class WindowsPathParser {
// Reserved characters for window path name
private static final String reservedChars = "<>:\"|?*"; // windows่ทฏๅพไธญ็้ๆณๅญ็ฌฆ
private WindowsPathParser() ... | src/src/sun/nio/fs/WindowsPathParser.java | 0.616012 | 0.410756 | WindowsPathParser.java | starcoder |
import java.util.ArrayList;
public class LjpMath {
public static double SolveAndCalculateLjp(ArrayList<Ion> list) throws Exception {
/*
* This method solves for phis to balance equations before calculating LJP, then
* updates all the ions in the given list based on these results.
... | dev/annotated-source/LjpMath.java | 0.73659 | 0.511839 | LjpMath.java | starcoder |
package org.orekit.propagation.semianalytical.dsst.forces;
import org.hipparchus.geometry.euclidean.threed.Vector3D;
import org.hipparchus.util.CombinatoricsUtils;
import org.hipparchus.util.FastMath;
import org.orekit.bodies.CelestialBody;
import org.orekit.propagation.semianalytical.dsst.utilities.AuxiliaryElements;... | src/main/java/org/orekit/propagation/semianalytical/dsst/forces/DSSTThirdBodyContext.java | 0.886094 | 0.559049 | DSSTThirdBodyContext.java | starcoder |
package org.darbots.darbotsftclib.libcore.calculations.dimentional_calculation;
import androidx.annotation.Nullable;
import com.acmerobotics.dashboard.FtcDashboard;
import com.acmerobotics.dashboard.telemetry.TelemetryPacket;
import com.acmerobotics.roadrunner.geometry.Pose2d;
import com.acmerobotics.roadrunner.geome... | DarbotsFtcLib/src/main/java/org/darbots/darbotsftclib/libcore/calculations/dimentional_calculation/XYPlaneCalculations.java | 0.811676 | 0.620808 | XYPlaneCalculations.java | starcoder |
package pt.ulisboa.tecnico.socialsoftware.tutor.tournament.dto;
import pt.ulisboa.tecnico.socialsoftware.tutor.config.DateHandler;
import pt.ulisboa.tecnico.socialsoftware.tutor.question.dto.AssessmentDto;
import pt.ulisboa.tecnico.socialsoftware.tutor.statement.dto.SolvedQuizDto;
import pt.ulisboa.tecnico.socialsoftw... | backend/src/main/java/pt/ulisboa/tecnico/socialsoftware/tutor/tournament/dto/TournamentDto.java | 0.720073 | 0.425426 | TournamentDto.java | starcoder |
package org.apache.drill.exec.record;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import org.apache.drill.common.expression.SchemaPath;
import org.apache.drill.common.types.TypeProtos.DataMode;
import ... | exec/java-exec/src/main/java/org/apache/drill/exec/record/SchemaUtil.java | 0.816736 | 0.476092 | SchemaUtil.java | starcoder |
import junit.framework.TestCase;
/**
*
*/
/**
*/
public class TimeTest extends TestCase {
private Time[] time;
public void setUp() {
time = new Time[27];
time[0] = new Time();
time[1] = new Time("105345.076");
time[2] = new Time("105346.076");
time[3] = new Time("105346.076")... | Server/Tools/BTGPSSimulator/TimeTest.java | 0.718298 | 0.441312 | TimeTest.java | starcoder |
package com.google.enterprise.adaptor.prebuilt;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import com.google.enterprise.adaptor.Metadata;
import com.google.enterprise.adaptor.MetadataTransform;
import org.junit.Test;
import java.util.HashMap;
import java.util.Map;
impor... | test/com/google/enterprise/adaptor/prebuilt/FilterMimetypesTest.java | 0.844184 | 0.495117 | FilterMimetypesTest.java | starcoder |
package neuralnet.ml.bayesian;
import neuralnet.Encog;
import neuralnet.util.csv.CSVFormat;
import java.io.Serializable;
/**
* A choice in a Bayesian network. Choices can be either discrete or continuous.
* For continuous choices the number must be made discrete by mapping it to
* discrete ranges.
*
*/
public ... | app/neuralnet/ml/bayesian/BayesianChoice.java | 0.895808 | 0.421254 | BayesianChoice.java | starcoder |
import com.dashoptimization.*;
import java.util.*;
import org.jgrapht.graph.*;
/**
* class representing a change and go network
* corresponds to a PTN and a line pool
*/
public class CAG {
/**
* list of OD nodes of the change and go graph
*/
protected ArrayList<Node> odNodes;
/**
* li... | src/line-planning/traveling-time/column-generation-approach/src/CAG.java | 0.639736 | 0.458591 | CAG.java | starcoder |
import java.io.*;
public class TileSystem {
protected final static double EarthRadius = 6378137;
protected final static double MinLatitude = -85.05112878;
protected final static double MaxLatitude = 85.05112878;
protected final static double MinLongitude = -180;
protected final static double MaxLongitude... | MapTile_RetrievalAndStitch/TileSystem.java | 0.82308 | 0.55254 | TileSystem.java | starcoder |
package sun.management.counter.perf;
import java.io.UnsupportedEncodingException;
/**
* A typesafe enumeration for the data types supported for
* performance data.
*
* <p> The enumeration values for this typesafe enumeration must be
* kept in synchronization with the PerfDataType enum in the
* globalsDefinition... | sourcecode8/src/sun/management/counter/perf/PerfDataType.java | 0.879684 | 0.429429 | PerfDataType.java | starcoder |
package com.opengamma.analytics.financial.instrument.future;
import javax.time.calendar.ZonedDateTime;
import org.apache.commons.lang.ObjectUtils;
import org.apache.commons.lang.Validate;
import com.opengamma.analytics.financial.instrument.InstrumentDefinition;
import com.opengamma.analytics.financial.instrument.Ins... | src/com/opengamma/analytics/financial/instrument/future/InterestRateFutureOptionPremiumSecurityDefinition.java | 0.898263 | 0.414306 | InterestRateFutureOptionPremiumSecurityDefinition.java | starcoder |
package com.pgrenaud.android.p2p.entity;
import android.location.Location;
import com.google.gson.annotations.SerializedName;
import java.util.Locale;
public class LocationEntity {
private static final String TO_STRING_FORMAT = "[%f, %f]";
@SerializedName("lat")
private Double latitude;
@Serialize... | library/src/main/java/com/pgrenaud/android/p2p/entity/LocationEntity.java | 0.927593 | 0.426202 | LocationEntity.java | starcoder |
package botenanna.math;
import java.util.Objects;
/** A vector with three components: x, y, z */
public class Vector3 {
public static final Vector3 UP = new Vector3(0, 0, 1);
public static final Vector3 RIGHT = new Vector3(1, 0, 0);
public static final Vector3 FORWARD = new Vector3(0, 1, 0);
public s... | src/main/java/botenanna/math/Vector3.java | 0.926827 | 0.848722 | Vector3.java | starcoder |
public class ExponentialNotation implements Comparable<ExponentialNotation>{
// Exponential Notation with base 10
private double coefficient;
private long exponent;
public ExponentialNotation(double coefficient, long exponent) {
this.coefficient = coefficient;
this.exponent = exponent;... | ExponentialNotation.java | 0.904928 | 0.497253 | ExponentialNotation.java | starcoder |
package com.opengamma.masterdb.security.hibernate.fx;
import static com.opengamma.masterdb.security.hibernate.Converters.currencyBeanToCurrency;
import static com.opengamma.masterdb.security.hibernate.Converters.dateTimeWithZoneToZonedDateTimeBean;
import static com.opengamma.masterdb.security.hibernate.Converters.ext... | projects/OG-MasterDB/src/main/java/com/opengamma/masterdb/security/hibernate/fx/NonDeliverableFXForwardSecurityBeanOperation.java | 0.838382 | 0.52208 | NonDeliverableFXForwardSecurityBeanOperation.java | starcoder |
package DataStructures.HashMap.Hashing;
import java.util.*;
/**
* This class is an implementation of a hash table using linear probing
* It uses a dynamic array to lengthen the size of the hash table when
* load factor > .7
*/
public class HashMapLinearProbing {
private int hsize; //size of the hash table
... | DataStructures/HashMap/Hashing/HashMapLinearProbing.java | 0.828002 | 0.442034 | HashMapLinearProbing.java | starcoder |
* Copyright 2014-2019 Intel Corporation
*
* 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
*
* Unless required by applicable law or agreed to i... | lang_interface/java/com/intel/daal/data_management/data/Matrix.java | 0.934185 | 0.535098 | Matrix.java | starcoder |
package java.time;
import static java.time.LocalTime.HOURS_PER_DAY;
import static java.time.LocalTime.MICROS_PER_DAY;
import static java.time.LocalTime.MILLIS_PER_DAY;
import static java.time.LocalTime.MINUTES_PER_DAY;
import static java.time.LocalTime.NANOS_PER_DAY;
import static java.time.LocalTime.NANOS_PER_HOUR;
i... | optashift-employee-rostering-gwtui/src/main/super/org/optaplanner/openshift/employeerostering/gwtui/emulate/java/time/LocalDateTime.java | 0.922284 | 0.464173 | LocalDateTime.java | starcoder |
package de.uni_passau.fim.seibt.v8.util;
/**
* A vector in 3D space.
*/
public class Vector3f implements Cloneable {
private float x;
private float y;
private float z;
/**
* Constructs a new <code>Vector</code> from the given coordinates.
*
* @param x
* the x-coordinate
... | src/de/uni_passau/fim/seibt/v8/util/Vector3f.java | 0.956248 | 0.722245 | Vector3f.java | starcoder |
package leetcode.p1008;
import leetcode.TreeNode;
/**
* 1008. Construct Binary Search Tree from Preorder Traversal
* Return the root node of a binary search tree that matches the given preorder traversal.
* (Recall that a binary search tree is a binary tree where for every node, any descendant of node.left has a v... | src/main/java/leetcode/p1008/Solution1008.java | 0.894017 | 0.54692 | Solution1008.java | starcoder |
package de.fhdo.lemma.utils;
import com.google.common.base.Objects;
import de.fhdo.lemma.utils.Pair;
import de.fhdo.lemma.utils.Pairs;
import de.fhdo.lemma.utils.RotatingWindowList;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.xtext.xbase.lib.CollectionLiterals;
import org.eclipse.xtext.xbase.... | de.fhdo.lemma.utils/xtend-gen/de/fhdo/lemma/utils/DistinctPairSeriesBuilder.java | 0.776284 | 0.500305 | DistinctPairSeriesBuilder.java | starcoder |
package edu.umd.cs.findbugs.graph;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.NoSuchElementException;
/**
* A simple Graph implementation where the vertex objects store a list of
* incoming and outgoing edges. The edge link fields are stored in the edge
* objects, which means a fairly ... | ui/data/RD findbugs/model/src/edu/umd/cs/findbugs/graph/AbstractGraph.java | 0.891466 | 0.580025 | AbstractGraph.java | starcoder |
package be.bagofwords.counts;
import java.util.Arrays;
public class SparseVector {
public int[] inds;
public float[] vals;
public int size;
public SparseVector() {
this.inds = new int[0];
this.vals = new float[0];
size = 0;
}
public void addValue(int ind, float value... | src/main/java/be/bagofwords/counts/SparseVector.java | 0.549882 | 0.402568 | SparseVector.java | starcoder |
package com.jparkie.aizoban.views.widgets;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import and... | app/src/main/java/com/jparkie/aizoban/views/widgets/GestureImageView.java | 0.900885 | 0.494019 | GestureImageView.java | starcoder |
*
* 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
*
* Unless required by applicable law or agreed to in writing, software
* distribut... | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRFloatImage.java | 0.954921 | 0.490724 | GVRFloatImage.java | starcoder |
package com.design.gangOfFour.creational.builder;
/**
* Builder pattern
*
* https://en.wikipedia.org/wiki/Builder_pattern
* https://refactoring.guru/design-patterns/builder {IMP} TODO
* https://medium.com/@andreaspoyias/design-patterns-a-quick-guide-to-builder-pattern-a834d7cacead
*
* Builder constructs complex... | src/main/java/com/design/gangOfFour/creational/builder/Main.java | 0.683314 | 0.484868 | Main.java | starcoder |
package org.springframework.util;
import java.io.ByteArrayOutputStream;
/**
* An extension of {@link ByteArrayOutputStream} that:
* <ul>
* <li>has public {@link org.springframework.util.ResizableByteArrayOutputStream#grow(int)}
* and {@link org.springframework.util.ResizableByteArrayOutputStream#resize(int)} meth... | spring-core/src/main/java/org/springframework/util/ResizableByteArrayOutputStream.java | 0.869465 | 0.430626 | ResizableByteArrayOutputStream.java | starcoder |
package info.u250.c2d.box2d;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.scenes.scene2d.Action;
import com.badlogic.gdx.scenes.scene2d.Group;
import info.u250.c2d.box2d.model.b2BodyDefMode... | c2d-core/src/main/java/info/u250/c2d/box2d/Box2dObject.java | 0.827967 | 0.434281 | Box2dObject.java | starcoder |
package com.opengamma.language.currency;
import java.util.List;
import com.google.common.collect.ImmutableList;
import com.opengamma.financial.currency.CurrencyPair;
import com.opengamma.financial.currency.CurrencyPairsSource;
import com.opengamma.language.context.SessionContext;
import com.opengamma.language.definit... | projects/OG-Language/Client/src/main/java/com/opengamma/language/currency/CurrencyPairFunction.java | 0.929232 | 0.542439 | CurrencyPairFunction.java | starcoder |
package com.microsoft.dhalion.core;
import java.time.Instant;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
import tech.tablesaw.api.CategoryColumn;
import tech.tablesaw.api.DoubleColumn;
import tech.tablesaw.api.LongCo... | src/main/java/com/microsoft/dhalion/core/MeasurementsTable.java | 0.761272 | 0.488649 | MeasurementsTable.java | starcoder |
package _4SumII;
import java.util.Arrays;
/**
* Given four lists A, B, C, D of integer values, compute how many tuples (i, j, k, l) there are
* such that A[i] + B[j] + C[k] + D[l] is zero.
*
* To make problem a bit easier, all A, B, C, D have same length of N where 0 โค N โค 500. All
* integers are in the range of... | src/_4SumII/Solution.java | 0.842378 | 0.551211 | Solution.java | starcoder |
import java.util.*;
// Scaled-down JSON parser that works with a subset of the JSON spec and returns a nested
// structure of Maps and Lists that contain only String keys and values.
public class JSONtoMap {
interface JNode {
void add (String key, Object val);
}
static class JList extends ArrayList<Obj... | src/JSONtoMap.java | 0.82308 | 0.451327 | JSONtoMap.java | starcoder |
<---------Stack Introduction------------>
Stack is a linear data structure that follows a particular order in which the operations are performed. The order may be LIFO(Last In First Out) or FILO(First In Last Out).
Mainly the following three basic operations are performed in the stack:
โข Push: Adds an item in the stac... | StackImplementation.java | 0.632389 | 0.792062 | StackImplementation.java | starcoder |
package org.joml;
import java.io.Externalizable;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.nio.ByteBuffer;
import java.nio.FloatBuffer;
import java.text.DecimalFormat;
import java.text.NumberFormat;
/**
* Contains the definition of a Vector compris... | src/org/joml/Vector3f.java | 0.938096 | 0.461441 | Vector3f.java | starcoder |
package org.apache.ratis.examples.arithmetic.expression;
import java.util.Map;
import java.util.regex.Pattern;
import org.apache.ratis.examples.arithmetic.AssignmentMessage;
import org.apache.ratis.util.Preconditions;
public class Variable implements Expression {
static final int LENGTH_LIMIT = 32;
static final ... | ratis-examples/src/main/java/org/apache/ratis/examples/arithmetic/expression/Variable.java | 0.896416 | 0.488222 | Variable.java | starcoder |
package io.debezium.util;
import java.math.BigDecimal;
/**
* A set of numeric conversion methods.
*
* @author <NAME>
*/
public class NumberConversions {
public static final Byte BYTE_TRUE = Byte.valueOf((byte) 1);
public static final Byte BYTE_FALSE = Byte.valueOf((byte) 0);
public static final Shor... | debezium-core/src/main/java/io/debezium/util/NumberConversions.java | 0.942612 | 0.508422 | NumberConversions.java | starcoder |
package org.springframework.geode.data.json.converter;
import java.util.Map;
import org.springframework.data.gemfire.util.CollectionUtils;
import org.springframework.geode.data.json.converter.support.JSONFormatterPdxToJsonConverter;
import org.springframework.lang.NonNull;
import org.springframework.lang.Nullable;
im... | spring-geode-project/spring-geode/src/main/java/org/springframework/geode/data/json/converter/AbstractObjectArrayToJsonConverter.java | 0.832237 | 0.493164 | AbstractObjectArrayToJsonConverter.java | starcoder |
package org.robotframework.ide.eclipse.main.plugin.tableeditor;
import static com.google.common.collect.Lists.newArrayList;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
impor... | src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin.tests/src/org/robotframework/ide/eclipse/main/plugin/tableeditor/TreeLayerAccessorTest.java | 0.843057 | 0.571707 | TreeLayerAccessorTest.java | starcoder |
package tech.tablesaw.columns.numbers;
import org.apache.commons.math3.stat.descriptive.SummaryStatistics;
import tech.tablesaw.api.DoubleColumn;
import tech.tablesaw.api.NumericColumn;
import tech.tablesaw.api.StringColumn;
import tech.tablesaw.api.Table;
public class Stats {
private long n;
private double... | core/src/main/java/tech/tablesaw/columns/numbers/Stats.java | 0.831725 | 0.519948 | Stats.java | starcoder |
package com.opengamma.financial.analytics.model.credit.isdanew;
import java.util.Collections;
import java.util.Set;
import com.opengamma.analytics.financial.credit.creditdefaultswap.pricing.vanilla.isdanew.ISDACompliantYieldCurve;
import com.opengamma.analytics.financial.credit.creditdefaultswap.pricing.vanilla.isdan... | projects/OG-Financial/src/main/java/com/opengamma/financial/analytics/model/credit/isdanew/ISDACompliantYieldCurveFunction.java | 0.637934 | 0.49048 | ISDACompliantYieldCurveFunction.java | starcoder |
package com.yxy.algorithms.max.sum;
/**
* @author <NAME>
* @Date 8/1/2015
*
* Question:
* The maximum subarray problem is the task of finding the contiguous subarray
* within a one-dimensional array of numbers (containing at least one positive number)
* which has the largest sum.
* For example, for the sequ... | src/main/java/com/yxy/algorithms/max/sum/MaxSumTest.java | 0.719778 | 0.604778 | MaxSumTest.java | starcoder |
package com.katpara.follium.linear.constants;
import com.katpara.follium.exceptions.InvalidParameterProvidedException;
import com.katpara.follium.exceptions.linears.InvalidMatrixDimensionProvidedException;
import com.katpara.follium.exceptions.linears.MatrixDimensionMismatchException;
import com.katpara.follium.except... | src/main/java/com/katpara/follium/linear/constants/ZeroMatrix.java | 0.963213 | 0.45847 | ZeroMatrix.java | starcoder |
package io.crate.expression.reference.sys;
import io.crate.data.Input;
import io.crate.metadata.ColumnIdent;
import io.crate.execution.engine.collect.NestableCollectExpression;
import io.crate.execution.engine.collect.CollectExpression;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
im... | server/src/main/java/io/crate/expression/reference/sys/SysRowUpdater.java | 0.673729 | 0.437403 | SysRowUpdater.java | starcoder |
package com.github.kilianB.datastructures.tree.binaryTree;
import java.io.Serializable;
import java.math.BigInteger;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.List;
import java.util.PriorityQueue;
import com.github.kilianB.datastructures.tree.AbstractBinaryTree;
import com.gi... | src/main/java/com/github/kilianB/datastructures/tree/binaryTree/BinaryTree.java | 0.878145 | 0.465691 | BinaryTree.java | starcoder |
package org.moeaframework.core.indicator;
import org.moeaframework.core.NondominatedPopulation;
import org.moeaframework.core.Problem;
import org.moeaframework.core.Settings;
/**
* Generational distance indicator. Represents average distance from solutions
* in an approximation set to the nearest solution i... | src/org/moeaframework/core/indicator/GenerationalDistance.java | 0.914859 | 0.428413 | GenerationalDistance.java | starcoder |
package leetcode.problems.linkedin;
/**
* 2040. Kth Smallest Product of Two Sorted Arrays
* Given two sorted 0-indexed integer arrays nums1 and nums2 as well as an integer k, return the kth (1-based) smallest product of nums1[i] * nums2[j] where 0 <= i < nums1.length and 0 <= j < nums2.length.
* <p>
* Example 1:
... | src/leetcode/problems/linkedin/_2040KthSmallestProductOfTwoSortedArrays.java | 0.874064 | 0.671683 | _2040KthSmallestProductOfTwoSortedArrays.java | starcoder |
package animalKingdom;
import java.util.ArrayList;
import java.util.List;
class Main
{
private static List<Animal> filterAnimals(List<Animal> originalList, FilterAnimal expr)
{
List<Animal> filteredList = new ArrayList<>();
for (Animal a : originalList)
{
if (expr.filter(a))
{
fil... | src/animalKingdom/Main.java | 0.779657 | 0.40592 | Main.java | starcoder |
package de.uniwue.informatik.praline.datastructure.labels;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import de.uniwue.informatik.praline.datastructure.graphs.Edge;
import de.uniwue.informatik.... | Praline-Data-Structure/src/main/java/de/uniwue/informatik/praline/datastructure/labels/EdgeLabelManager.java | 0.84994 | 0.427098 | EdgeLabelManager.java | starcoder |
package com.facebook.buck.util.concurrent;
import static com.google.common.util.concurrent.MoreExecutors.newDirectExecutorService;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import com.google.common.util.concurrent.ListenableFuture... | test/com/facebook/buck/util/concurrent/WeightedListeningExecutorServiceTest.java | 0.869618 | 0.470554 | WeightedListeningExecutorServiceTest.java | starcoder |
package seedu.contax.commons.util.datetimeparser;
import static java.util.Objects.requireNonNull;
import java.time.DateTimeException;
import java.time.LocalTime;
import java.util.Optional;
import java.util.regex.Matcher;
/**
* Provides parsing services for time inputs used in the application.
*/
public class TimeP... | src/main/java/seedu/contax/commons/util/datetimeparser/TimeParser.java | 0.933408 | 0.646697 | TimeParser.java | starcoder |
package simpplle.comcode;
import java.io.PrintWriter;
import java.util.ArrayList;
/**
* This class defines Fire Suppersion Beyond Class A Logic, a type of Base Logic. Determining whether a fire stays at class A or goes beyond is an
* important factor in Fire logic defined below
*
* Fire Process logic
... | src/main/simpplle/comcode/FireSuppBeyondClassALogic.java | 0.732018 | 0.421969 | FireSuppBeyondClassALogic.java | starcoder |
package org.tensorflow.op.audio;
import org.tensorflow.Operand;
import org.tensorflow.Operation;
import org.tensorflow.OperationBuilder;
import org.tensorflow.Output;
import org.tensorflow.op.RawOp;
import org.tensorflow.op.Scope;
import org.tensorflow.op.annotation.Endpoint;
import org.tensorflow.op.annotation.Opera... | tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/audio/AudioSpectrogram.java | 0.947902 | 0.673687 | AudioSpectrogram.java | starcoder |
package ModelLayer.CollisionManagement;
import ControlLayer.SharedResources;
import ModelLayer.Car;
import ModelLayer.Enumerations.InGameObjectType;
import ModelLayer.Player;
import java.awt.*;
import java.awt.geom.Line2D;
import java.util.ArrayList;
import java.util.stream.Stream;
/**
* Calculates col... | src/ModelLayer/CollisionManagement/CollisionManager.java | 0.899128 | 0.408483 | CollisionManager.java | starcoder |
package org.apache.commons.math4.ode.nonstiff;
import org.apache.commons.math4.exception.DimensionMismatchException;
import org.apache.commons.math4.exception.MaxCountExceededException;
import org.apache.commons.math4.exception.NoBracketingException;
import org.apache.commons.math4.exception.NumberIsTooSmallException;... | src/main/java/org/apache/commons/math4/ode/nonstiff/AdaptiveStepsizeIntegrator.java | 0.944702 | 0.479199 | AdaptiveStepsizeIntegrator.java | starcoder |
package com.github.caniblossom.polybounce.game.objects;
import com.github.caniblossom.polybounce.math.BoundingBox;
import com.github.caniblossom.polybounce.math.ConvexPolygon;
import com.github.caniblossom.polybounce.math.Vector2;
import com.github.caniblossom.polybounce.physics.body.RigidBody;
import com.github.canib... | PolyBounce/src/main/java/com/github/caniblossom/polybounce/game/objects/Ramp.java | 0.948227 | 0.52275 | Ramp.java | starcoder |
package ncl.cs.prime.diagrams;
import java.io.IOException;
import java.io.PrintWriter;
import ncl.cs.prime.diagrams.Data.Formula;
import ncl.cs.prime.diagrams.Data.Row;
public class Diagrams {
public static final String PATH = "../odroid/data7b_171025a/results";
public static final String[] LAWS = {"amd", "bal", ... | procdata/src/ncl/cs/prime/diagrams/Diagrams.java | 0.582847 | 0.412294 | Diagrams.java | starcoder |
package edu.gemini.qpt.shared.util;
import java.io.Serializable;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import edu.gemini.spModel.core.SPProgramID;
/**
* SPProgramID that knows its internal structure.
* Note: This code can probably be replaced with ProgramId / ProgramType from the core modu... | bundle/edu.gemini.qpt.shared/src/main/java/edu/gemini/qpt/shared/util/StructuredProgramID.java | 0.663996 | 0.41561 | StructuredProgramID.java | starcoder |
package us.ihmc.robotics.geometry.shapes;
import us.ihmc.euclid.geometry.Shape3D;
import us.ihmc.euclid.referenceFrame.FrameGeometryObject;
import us.ihmc.euclid.referenceFrame.FramePoint3D;
import us.ihmc.euclid.referenceFrame.FrameVector3D;
import us.ihmc.euclid.referenceFrame.ReferenceFrame;
import us.ihmc.euclid.t... | ihmc-robotics-toolkit/src/main/java/us/ihmc/robotics/geometry/shapes/FrameShape3d.java | 0.938646 | 0.789558 | FrameShape3d.java | starcoder |
package kcn.calculation;
/**
* <p>Instances of Formula class is able to do between 0 and n series calculations on input factors
* supplied as Double arrays.</p>
*
* <p>A description should be made, but I can't be bothered right now:</p>
* <p>Ex.</p>
* <p>Formula formulaEx = new Formula("(n*n)^(n+1)");</p>
* <p... | src/kcn/calculation/Formula.java | 0.792183 | 0.632176 | Formula.java | starcoder |
package algs.coding_jam;
/**
Write a function that takes an unsigned integer and return
the number of '1' bits it has (also known as the Hamming weight (http://en.wikipedia.org/wiki/Hamming_weight)).
Example 1:
Input: 00000000000000000000000000001011
Output: 3
Explanation: The input binary str... | algs/src/java/main/java/algs/coding_jam/NumberOf1Bits.java | 0.790288 | 0.673841 | NumberOf1Bits.java | starcoder |
package org.optaplanner.examples.cheaptime.solver.move.factory;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import org.optaplanner.core.api.score.director.ScoreDirector;
import org.optaplanner.core.impl.he... | optaplanner-examples/src/main/java/org/optaplanner/examples/cheaptime/solver/move/factory/CheapTimePillarSlideMoveIteratorFactory.java | 0.78016 | 0.405213 | CheapTimePillarSlideMoveIteratorFactory.java | starcoder |
package com.dipasquale.common.random.float1;
import java.io.Serial;
import java.io.Serializable;
public final class QuadrupleSigmoidRandomSupport implements RandomSupport, Serializable {
@Serial
private static final long serialVersionUID = -4181447142293325129L;
private static final float MAX_VALUE_LESS_T... | src/com/dipasquale/common/random/float1/QuadrupleSigmoidRandomSupport.java | 0.918574 | 0.521593 | QuadrupleSigmoidRandomSupport.java | starcoder |
*
* Date: 17/09/2015
*
* Hacker rank
* Week of code 17
* Problem: Cross the River
* Status: timeout
*
* You're standing on a shore of a river. You'd like to reach the opposite shore.
* The river can be described with two straight lines on the Cartesian plane,
* describing the shores. The shore you're sta... | java/hackerrank/src/main/java/com/vaani/hackerrank/weekofcode/_17/CrossTheRiver.java | 0.85558 | 0.633722 | CrossTheRiver.java | starcoder |
package org.lwjgl.util.meshoptimizer;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.MemoryStack.*;
/**
* Experimental: Meshlet
*
* <h3>Layout</h3>
*
* <pre><code>
* struct meshopt_Mesh... | modules/lwjgl/meshoptimizer/src/generated/java/org/lwjgl/util/meshoptimizer/MeshoptMeshlet.java | 0.921935 | 0.408808 | MeshoptMeshlet.java | starcoder |
package org.onebusaway.collections;
import java.io.Serializable;
import java.util.Collection;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.SortedMap;
/**
* A extension of {@link HashMap} that will automatically create a {@link Map}
* key-value e... | src/main/java/org/onebusaway/collections/FactoryMap.java | 0.95902 | 0.404213 | FactoryMap.java | starcoder |
package com.yahoo.sketches.tuple;
import static com.yahoo.sketches.Util.DEFAULT_NOMINAL_ENTRIES;
/**
* Compute a union of two or more tuple sketches.
* A new instance represents an empty set.
* Every update() computes a union with the internal set
* and can only grow the internal set.
* @param <S> Type of Summar... | src/main/java/com/yahoo/sketches/tuple/Union.java | 0.925982 | 0.417568 | Union.java | starcoder |
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.
package com.facebook.react.uimanager.annotations;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
... | ReactAndroid/src/main/java/com/facebook/react/uimanager/annotations/ReactPropGroup.java | 0.87127 | 0.437042 | ReactPropGroup.java | starcoder |
package org.algo.matrix.decomposition;
import java.math.BigDecimal;
import org.algo.access.Access2D;
import org.algo.matrix.store.MatrixStore;
import org.algo.matrix.store.PhysicalStore;
import org.algo.scalar.ComplexNumber;
import org.algo.type.context.NumberContext;
/**
* Hessenberg: [A] = [Q][H][Q]<sup>T</sup> A... | src/main/java/org/algo/matrix/decomposition/Hessenberg.java | 0.857828 | 0.408483 | Hessenberg.java | starcoder |
import java.util.*;
public class GetCourses {
private CourseList electives;
private CourseList core;
private CourseList foundation;
private Recomender recomender;
public GetCourses() {
this.electives = new CourseList();
this.core = new CourseList();
this.foundation = new Co... | GetCourses.java | 0.574634 | 0.474631 | GetCourses.java | starcoder |
* Q. ์ฃผ์ด์ง A์ ๋ํ ์์
ํ ๋ชจ๋ ์นด์ดํฐ์ ๊ฐ์ ๊ณ์ฐํ๋ ๊ฒ
* A. https://app.codility.com/demo/results/trainingSPE9PT-Z3T/
* TestScore. 77%
*
* Analysis summary.
* timeout errors.
*/
class Solution1 {
public int[] solution(int N, int[] A) {
int[] X = new int[N];
// ์ฆ๊ฐ - ์นด์ดํฐ X๊ฐ 1 ์ฉ ์ฆ๊ฐํ๋ฉฐ,
// ์ต๋ ์นด์ดํฐ - ๋ชจ๋ ... | Java/Codility/src/4_CountingElements/MaxCounters.java | 0.737725 | 0.619126 | MaxCounters.java | starcoder |
package org.apache.dolphinscheduler.common.utils.dependent;
import org.apache.dolphinscheduler.common.model.DateInterval;
import org.apache.dolphinscheduler.common.utils.DateUtils;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class DependentDateUtils {
/**
* get last day... | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/dependent/DependentDateUtils.java | 0.866909 | 0.542742 | DependentDateUtils.java | starcoder |
package emulatorinterface.translator.arm.registers;
import java.util.Hashtable;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import generic.Operand;
public class Registers
{
private static Hashtable<String, Long> integerRegistersHashTable = null;
private static Hashtable<String, Long> floatRe... | Tejas-Simulator/Tejas/src/simulator/emulatorinterface/translator/arm/registers/Registers.java | 0.547222 | 0.597256 | Registers.java | starcoder |
package com.github.tommyettinger;
import com.badlogic.gdx.graphics.Camera;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.utils.ObjectMap;
import com.badlogic.gdx.utils.Scaling;
import com.badlogic.gdx.utils.viewport.Viewport;
/**
* A viewport that ... | core/src/main/java/com/github/tommyettinger/PixelPerfectViewport.java | 0.956533 | 0.561215 | PixelPerfectViewport.java | starcoder |
package org.apache.solr.analytics.util;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
/**
* Calculates ordinals of a comparable list by placing them in the correct positions in the list.
* <p>
* Implements the QuickSelect algorithm, but modifies it to select multiple ordinals all at ... | solr/contrib/analytics/src/java/org/apache/solr/analytics/util/OrdinalCalculator.java | 0.864654 | 0.585397 | OrdinalCalculator.java | starcoder |
package cracking_the_coding_interview.chapter_16.exercise_09;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
public class SolutionTest {
private final Solution solution = new Solution();
@Test
public void subtract_1() throws Exception {
final int a = 0;
final int b ... | test/cracking_the_coding_interview/chapter_16/exercise_09/SolutionTest.java | 0.943867 | 0.412885 | SolutionTest.java | starcoder |
package org.archive.util;
import java.util.regex.Matcher;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
/**
* JUnit test suite for TextUtils
*
* @author gojomo
* @version $ Id$
*/
public class TextUtilsTest extends TestCase {
/**
* Create a new TextUti... | code/crawler/src/org/archive/util/TextUtilsTest.java | 0.746971 | 0.425307 | TextUtilsTest.java | starcoder |
package com.sensiblemetrics.api.alpenidos.adt.list.linkedlist;
public class LinkedList<T extends Comparable<T>> implements List<T> {
private Node<T> root;
private int size;
@Override
public int size() {
return this.size;
}
@Override
public void remove(T data) {
this.size... | src/main/java/com/sensiblemetrics/api/alpenidos/adt/list/linkedlist/LinkedList.java | 0.881691 | 0.459197 | LinkedList.java | starcoder |
package org.eclipse.microprofile.lra.annotation;
import org.eclipse.microprofile.lra.annotation.ws.rs.Leave;
/**
* A representation of the status of a participant according to a participant state model:
*
* The initial state {@link #Active} is entered when a participant is first associated with a Long Running Acti... | api/src/main/java/org/eclipse/microprofile/lra/annotation/ParticipantStatus.java | 0.748536 | 0.402803 | ParticipantStatus.java | starcoder |
package com.android.tools.lint.detector.api;
import static com.android.SdkConstants.ANDROID_URI;
import com.android.SdkConstants;
import com.android.annotations.NonNull;
import com.android.annotations.Nullable;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.intellij.psi.PsiE... | base/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/LintFix.java | 0.732879 | 0.446555 | LintFix.java | starcoder |
package sim.field.partitioning;
import java.util.*;
import java.util.stream.*;
// TODO Currently all shapes are restricted to IntHyperRect - switch to NdRectangle once it is completed
/**
* A node in a Quad Tree.
*
*/
public class QuadTreeNode {
final int nd;
int level, id; // which level in the tree the node is... | contrib/distributed/src/main/java/sim/field/partitioning/QuadTreeNode.java | 0.583203 | 0.4881 | QuadTreeNode.java | starcoder |
package others;
public class Algorithms {
public static int jumpSearch(int[] array, int target) {
int currentRight = 0; // right border of the current block
int prevRight = 0; // right border of the previous block
/* If array is empty, the element is not found */
if (array.length == 0) {
... | java/src/main/java/others/Algorithms.java | 0.746786 | 0.698516 | Algorithms.java | starcoder |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.