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 com.uwsoft.editor.utils;
import com.badlogic.gdx.math.Matrix3;
import com.badlogic.gdx.math.Vector2;
import com.uwsoft.editor.renderer.components.TransformComponent;
/**
* Created by <NAME> on 4/18/2016.
*/
public class TransformUtils {
private static final Matrix3 tempMat = new Matrix3();
public... | overlap2d/src/com/uwsoft/editor/utils/TransformUtils.java | 0.755276 | 0.494629 | TransformUtils.java | starcoder |
package org.omnaest.utils.table;
import org.omnaest.utils.structure.element.converter.ElementConverter;
/**
* A {@link Row} represents the horizontal {@link Stripe} of elements of a {@link Table}<br>
* <br>
* By default a {@link Row} will reflect any changes to its underlying {@link Table}. Even the removin... | utils-apl-derived-table/src/main/java/org/omnaest/utils/table/Row.java | 0.93417 | 0.419351 | Row.java | starcoder |
package flens.core;
import flens.typing.MetricForm;
import flens.typing.MetricType;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
//time in milis
pu... | src/main/java/flens/core/Record.java | 0.63477 | 0.543833 | Record.java | starcoder |
package com.kdgregory.geoutil.lib.core;
import java.time.Instant;
/**
* Utility functions to work with individual points.
*/
public class PointUtil
{
/**
* The base length of a degree in meters, used for Pythagorean diestance
* calculations. This is the length of a degree of latitude at 45 N/S as
... | lib/src/main/java/com/kdgregory/geoutil/lib/core/PointUtil.java | 0.901573 | 0.669849 | PointUtil.java | starcoder |
package physics;
import exceptions.ImpossiblePairException;
import geometry.intersections.IntersectionalPair;
import geometry.objects.Segment;
import geometry.objects.Triangle;
import geometry.objects3D.Line3D;
import geometry.objects3D.Plane3D;
import geometry.objects3D.Point3D;
import geometry.objects3D.Vector3D;
im... | src/physics/CollisionalPair.java | 0.608245 | 0.462594 | CollisionalPair.java | starcoder |
package net.sf.jncu.util;
import net.sf.jncu.fdil.NSOFInteger;
/**
* Newton date utilities.
* <p>
* These functions use the system clock value, which is either the number of
* minutes since midnight, January 1, 1904 or the number of seconds since
* midnight, January 1, 1993.
*
* @author moshew
*/
public class... | app/src/net/sf/jncu/util/NewtonDateUtils.java | 0.917815 | 0.611846 | NewtonDateUtils.java | starcoder |
public class HamiltonianPathCert extends Certificate {
private int[] path;
/**
* e.g I have 4 vertices in my graph
*
* xij: i indexes the choices I make,
* j indexes the vertices in the graph
*
* x00 x01 **x02** x03
* **x10** x11 x12 x13
... | src/HamiltonianPathCert.java | 0.748352 | 0.440289 | HamiltonianPathCert.java | starcoder |
package com.gengoai.apollo.ml.transform;
import com.gengoai.Copyable;
import com.gengoai.apollo.math.linalg.NDArrayFactory;
import com.gengoai.apollo.ml.DataSet;
import com.gengoai.apollo.ml.Datum;
import com.gengoai.apollo.ml.ObservationMetadata;
import com.gengoai.apollo.ml.observation.Observation;
import com.gengoa... | apollo/src/main/java/com/gengoai/apollo/ml/transform/AbstractSingleSourceTransform.java | 0.942968 | 0.412057 | AbstractSingleSourceTransform.java | starcoder |
package objects;
import java.io.IOException;
import java.util.ArrayList;
import java.util.StringTokenizer;
//Tree class is partially based on code found at https://www.cs.dartmouth.edu/~cbk/classes/10/15spring/notes/7/code/BinaryTree.java
//@author <NAME>-Kellogg, Dartmouth CS 10, Fall 2012
public class Tree<T> {
//... | ta_eclipse/src/objects/Tree.java | 0.723407 | 0.459682 | Tree.java | starcoder |
package org.nbousquet.algorithms.sort;
import org.nbousquet.algorithms.common.Utils;
public class HeapSort {
/**
* Sort the provided array using heap sort.
* <p>
* A "max heap" is a binary tree where each node hold a bigger value than its 2 children.
* We can efficiently store it as an array ... | src/main/java/org/nbousquet/algorithms/sort/HeapSort.java | 0.853303 | 0.659323 | HeapSort.java | starcoder |
package com.pdftron.pdf.utils;
// https://www.programcreek.com/java-api-examples/index.php?source_dir=DroidGraph-master/src/com/android/droidgraph/util/Vec2.java
// Modified by PDFTron
import android.graphics.PointF;
public class Vec2 {
/**
* x coordinate of the vector
*/
private double x;
/**
... | lib/src/PDFViewCtrlTools/src/com/pdftron/pdf/utils/Vec2.java | 0.943165 | 0.574604 | Vec2.java | starcoder |
package LinkedList;
/**
* Created by lyujiazhang on 9/19/16.
* https://leetcode.com/problems/add-two-numbers/
*
* You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a linke... | src/LinkedList/AddTwoNumbers.java | 0.909579 | 0.567337 | AddTwoNumbers.java | starcoder |
package com.opengamma.strata.pricer.capfloor;
import static com.opengamma.strata.market.ValueType.NORMAL_VOLATILITY;
import java.time.LocalDate;
import java.time.Period;
import java.time.ZonedDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Function;
import com.opengamma.strata.... | modules/pricer/src/main/java/com/opengamma/strata/pricer/capfloor/SurfaceIborCapletFloorletVolatilityBootstrapper.java | 0.922826 | 0.634656 | SurfaceIborCapletFloorletVolatilityBootstrapper.java | starcoder |
import java.util.Iterator;
import java.util.Map;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ConcurrentHashMap;
public class ConcurrentHashMapTest {
private static final int ThreadCount = 4;
private static final int IterationCount = 100;
private static final int Range = 10;
private s... | test/ConcurrentHashMapTest.java | 0.780662 | 0.453746 | ConcurrentHashMapTest.java | starcoder |
package marc.henrard.murisq.product.swap.type;
import static com.opengamma.strata.basics.index.IborIndices.GBP_LIBOR_3M;
import static com.opengamma.strata.basics.index.OvernightIndices.GBP_SONIA;
import static com.opengamma.strata.basics.schedule.Frequency.P3M;
import static com.opengamma.strata.product.swap.Overnigh... | src/main/java/marc/henrard/murisq/product/swap/type/ComplementOvernightIborSwapConventions.java | 0.802285 | 0.652041 | ComplementOvernightIborSwapConventions.java | starcoder |
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.nio.file.Files;
import java.util.Arrays;
import java.util.List;
import java.util.Random;
/**
* Generator which creates a test where Java 7 dual-pivot quicksort algorithm runs in O(n^2) time.
* <p>
* Number of operations is not... | java/src/Java7QuicksortKiller.java | 0.773601 | 0.424472 | Java7QuicksortKiller.java | starcoder |
package org.primordion.xholon.base;
import java.util.Map;
/**
* An InheritanceHierarchy represents a hierarchy (tree) of XholonClass nodes that
* inherit from other XholonClass nodes.
* It encapsulates the root node of a XholonClass hierarchy (rootNode).
* Primary roles of the InheritanceHierarchy are:
* (1) to ... | Xholon/src/org/primordion/xholon/base/IInheritanceHierarchy.java | 0.896101 | 0.416619 | IInheritanceHierarchy.java | starcoder |
package org.apache.flink.api.common.typeutils;
import org.apache.flink.annotation.PublicEvolving;
import org.apache.flink.core.memory.DataInputView;
import org.apache.flink.core.memory.DataOutputView;
import org.apache.flink.core.memory.MemorySegment;
import java.io.IOException;
import java.io.Serializable;
/**
* T... | flink-core/src/main/java/org/apache/flink/api/common/typeutils/TypeComparator.java | 0.950227 | 0.512022 | TypeComparator.java | starcoder |
package eu.quanticol.moonlight.monitoring;
import eu.quanticol.moonlight.formula.*;
import eu.quanticol.moonlight.monitoring.spatialtemporal.SpatialTemporalMonitor;
import eu.quanticol.moonlight.space.DistanceStructure;
import eu.quanticol.moonlight.space.SpatialModel;
import eu.quanticol.moonlight.domain.SignalDomain... | core/src/main/java/eu/quanticol/moonlight/monitoring/SpatialTemporalMonitoring.java | 0.920258 | 0.435902 | SpatialTemporalMonitoring.java | starcoder |
package com.google.android.gms.maps;
public final class R {
private R() {}
public static final class attr {
private attr() {}
public static final int ambientEnabled = 0x7f040029;
public static final int cameraBearing = 0x7f04005c;
public static final int cameraMaxZoomPreferenc... | app/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r/com/google/android/gms/maps/R.java | 0.623606 | 0.443962 | R.java | starcoder |
package tarehart.rlbot.steps.landing;
import tarehart.rlbot.math.vector.Vector2;
import tarehart.rlbot.math.vector.Vector3;
import tarehart.rlbot.AgentInput;
import tarehart.rlbot.AgentOutput;
import tarehart.rlbot.Bot;
import tarehart.rlbot.input.CarData;
import tarehart.rlbot.input.CarOrientation;
import tarehart.rl... | java/src/tarehart/rlbot/steps/landing/LandGracefullyStep.java | 0.680135 | 0.443721 | LandGracefullyStep.java | starcoder |
package orgomg.cwm.analysis.datamining;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EEnum;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
import orgomg.cwm.objectmodel.core.CorePackage;
/**
* <!-- begin-user-doc --> The <... | main/plugins/org.talend.cwm.mip/src/orgomg/cwm/analysis/datamining/DataminingPackage.java | 0.684264 | 0.648299 | DataminingPackage.java | starcoder |
import java.util.Date;
import java.util.Locale;
public class Flight {
private String flightFrom;
private String flightTo;
private int numPassengers;
private double price;
private Date date;
private Airplane airplane;
private double duration;
private String status;
public Flight(S... | Java/06_Airplane-Flights/src/Flight.java | 0.729038 | 0.538134 | Flight.java | starcoder |
package sample;
import java.util.ArrayList;
import java.util.HashMap;
public class Image {
public int width;
public int height;
public Color[][] pixels;
public Image(javafx.scene.image.Image image) {
this.width = (int) image.getWidth();
this.height = (int) image.getHeight();
t... | src/sample/Image.java | 0.743634 | 0.483039 | Image.java | starcoder |
package org.dariushmoshiri.cantorstack;
import javafx.util.Pair;
import java.math.BigInteger;
import java.util.Iterator;
import java.util.NoSuchElementException;
import java.util.function.Function;
/**
* This kind of stack stores all the information inside a number by using the Cantor Pairing Function.
* It can be... | src/org/dariushmoshiri/cantorstack/CantorStack.java | 0.910243 | 0.602734 | CantorStack.java | starcoder |
package io.binac.leetcode.util;
import java.util.LinkedList;
import java.util.Queue;
public class Trees {
private Trees() {
}
public static TreeNode asTree(Integer... a) {
if (a == null || a.length == 0 || a[0] == null)
return null;
Queue<TreeNode> queue = new LinkedList<>();... | java/src/main/java/io/binac/leetcode/util/Trees.java | 0.907443 | 0.416025 | Trees.java | starcoder |
package no.sintef.bvr.planner;
import java.util.BitSet;
import java.util.Objects;
import static no.sintef.bvr.planner.Status.*;
/**
* The state of a given realisation: maps each feature to its current status.
*/
public class State {
private static final String INCONSISTENT_INDEXES_AND_STATUSES = "Inconsistent ... | Planner/src/main/java/no/sintef/bvr/planner/State.java | 0.890996 | 0.526221 | State.java | starcoder |
package de.hpi.isg.sindy.util;
import de.hpi.isg.sindy.data.IntObjectTuple;
import it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap;
import org.apache.flink.api.common.accumulators.Accumulator;
/**
* An {@link Accumulator} to count the number of columns in the different tables.
*/
public class TableWidthAccumulator im... | sindy-core/src/main/java/de/hpi/isg/sindy/util/TableWidthAccumulator.java | 0.890824 | 0.418162 | TableWidthAccumulator.java | starcoder |
package seedu.address.model.deliverable;
import java.nio.file.Path;
import java.util.function.Predicate;
import javafx.collections.ObservableList;
import seedu.address.commons.core.GuiSettings;
import seedu.address.model.ReadOnlyUserPrefs;
import seedu.address.model.deliverable.deliverable.Deliverable;
/**
* Api of... | src/main/java/seedu/address/model/deliverable/ModelDeliverable.java | 0.801392 | 0.419053 | ModelDeliverable.java | starcoder |
package toothpick.config;
import java.util.HashSet;
import java.util.Set;
import toothpick.ProvidesSingletonInScope;
/**
* Defines a set of bindings, {@code Module} instances are installed in a scope.
*
* There are a few kinds of bindings :
* <dl>
* <dt><tt>bind(IFoo.class).to(Foo.class)</tt></dt>
* <dd>binds a... | toothpick/src/main/java/toothpick/config/Module.java | 0.914409 | 0.401306 | Module.java | starcoder |
package org.bloc97.api.darksky.data;
import org.bloc97.api.darksky.data.ForecastDataPointAll;
import java.util.Date;
/**
*
* @author bowen
*/
public class ForecastDataPoint {
private final double cloudCover, dewPoint, humidity;
private final String icon; //clear-day, clear-night, rain, snow, sleet, wind, f... | src/main/java/org/bloc97/api/darksky/data/ForecastDataPoint.java | 0.862742 | 0.432902 | ForecastDataPoint.java | starcoder |
package org.apache.flink.table.planner.delegation.hive.copy;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** Counterpart of hive's org.apache.hadoop.hive.ql.parse.QBExpr. */
public class HiveParserQBExpr {
private static final Logger LOG = LoggerFactory.getLogger(HiveParserQBExpr.class);
/** Op... | flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/planner/delegation/hive/copy/HiveParserQBExpr.java | 0.76207 | 0.407569 | HiveParserQBExpr.java | starcoder |
package io.micrometer.core.instrument.histogram;
import io.micrometer.core.annotation.Incubating;
import io.micrometer.core.instrument.Clock;
import io.micrometer.core.instrument.histogram.pause.ClockDriftPauseDetector;
import io.micrometer.core.instrument.histogram.pause.NoPauseDetector;
import org.HdrHistogram.Histo... | micrometer-core/src/main/java/io/micrometer/core/instrument/histogram/TimeWindowLatencyHistogram.java | 0.908035 | 0.498047 | TimeWindowLatencyHistogram.java | starcoder |
package com.opengamma.analytics.financial.interestrate;
import org.threeten.bp.LocalDate;
import com.opengamma.analytics.financial.instrument.InstrumentDefinitionVisitorAdapter;
import com.opengamma.analytics.financial.instrument.payment.CouponFixedDefinition;
import com.opengamma.analytics.financial.instrument.payme... | projects/OG-Analytics/src/main/java/com/opengamma/analytics/financial/interestrate/CouponPaymentDateVisitor.java | 0.862685 | 0.451508 | CouponPaymentDateVisitor.java | starcoder |
package no.ion.jake.graph;
public class DepthFirstSearch {
public interface Listener<U> {
void onStartOfVisit(Vertex<U> vertex);
void onEndOfVisit(Vertex<U> vertex);
}
public static <T> void traverse(Graph<T> graph, Listener<T> listener) {
Graph<DFSNode<T>> dfsGraph = graph.transfo... | src/no/ion/jake/graph/DepthFirstSearch.java | 0.874948 | 0.475788 | DepthFirstSearch.java | starcoder |
package Chess.Basics;
import Chess.Structure.Board;
import Chess.Structure.Config;
import Chess.Structure.Game;
import java.util.ArrayList;
public class Queen extends Piece {
public Queen(PieceColor color) {
super(new String[] {"♕", "♛"}, color);
}
@Override
public boolean isValidMove(Squar... | Group5Chess/src/Chess/Basics/Queen.java | 0.631594 | 0.451508 | Queen.java | starcoder |
package org.terasology.engine.rendering.primitives;
import org.joml.Vector3fc;
import org.lwjgl.opengl.GL30;
import org.terasology.engine.rendering.assets.material.Material;
import org.terasology.engine.rendering.assets.mesh.resource.VertexResource;
public class ChunkMeshImpl implements ChunkMesh {
/* VERTEX DA... | engine/src/main/java/org/terasology/engine/rendering/primitives/ChunkMeshImpl.java | 0.846926 | 0.404978 | ChunkMeshImpl.java | starcoder |
package net.matt_with_a_hat.WarpPadHelpers;
import java.util.HashMap;
import java.util.Map;
import org.jetbrains.annotations.Nullable;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
public class WarpPadTree
{
//To save memory and time, we store a list of all chunks that contain warp ... | src/main/java/net/matt_with_a_hat/WarpPadHelpers/WarpPadTree.java | 0.691497 | 0.506103 | WarpPadTree.java | starcoder |
package com.util;
import java.util.ArrayList;
import java.util.List;
import com.model.Position;
public class RuntimeGroupList {
public List<Position> list01 = new ArrayList<Position>();
public List<Position> list02 = new ArrayList<Position>();
public List<Position> list03 = new ArrayList<Position>();
... | src/main/java/com/util/RuntimeGroupList.java | 0.592549 | 0.400955 | RuntimeGroupList.java | starcoder |
package java_integration.fixtures;
public class MethodNames {
public static void lowercase1() {}
public static void camelCase1() {}
public static void camelWithUPPER1() {}
public static void camelWITHUpper1() {}
public static void CAMELWithUpper1() {}
public static Object getValue1() {retu... | spec/java_integration/fixtures/MethodNames.java | 0.732305 | 0.418459 | MethodNames.java | starcoder |
import java.awt.Color;
import java.awt.Container;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.GridLayout;
import java.awt.image.BufferedImage;
/** This class is used to render a single tile. */
class TilePreview extends Component {
/** The image to be drawn onto the window. */
private Bu... | utilities/WallGeneratorPreviewGrid.java | 0.917316 | 0.452052 | WallGeneratorPreviewGrid.java | starcoder |
package mpd;
public class ThreadedMinimumPairwiseDistance implements MinimumPairwiseDistance {
// Create two variables to be used throughout the program: globalResult is the smalled distance, and values is the initial list passed in.
public long globalResult = Integer.MAX_VALUE;
public int[] values;
... | src/mpd/ThreadedMinimumPairwiseDistance.java | 0.844858 | 0.483039 | ThreadedMinimumPairwiseDistance.java | starcoder |
package net.community.chest.math;
/**
* <P>Copyright as per GPLv2</P>
* @author <NAME>.
* @since Jun 12, 2011 8:06:31 AM
*/
public final class DivisionSigns {
private DivisionSigns ()
{
// no instance
}
/**
* @param value Value to be checked
* @return <code>true</code> if value is... | chest/base-utils/math/src/main/java/net/community/chest/math/DivisionSigns.java | 0.956796 | 0.46393 | DivisionSigns.java | starcoder |
package com.uber.hoodie.common.util.collection;
import java.io.Serializable;
import java.util.Map;
import org.apache.commons.lang.builder.CompareToBuilder;
/**
* (NOTE: Adapted from Apache commons-lang3)
* <p>A pair consisting of two elements.</p>
*
* <p>This class is an abstract implementation defining the basic... | hoodie-common/src/main/java/com/uber/hoodie/common/util/collection/Pair.java | 0.95533 | 0.449755 | Pair.java | starcoder |
package com.ByteCrunchers.TransGo.RealTimeOCR;
import java.util.List;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Paint.Style;
import android.graphics.Point;
import android.graphics.Rect;
/**
* Encapsulates the result of OCR.
*/
public clas... | OCRTest/src/main/java/com/ByteCrunchers/TransGo/RealTimeOCR/OcrResult.java | 0.884114 | 0.413596 | OcrResult.java | starcoder |
package org.ggp.base.player.gamer.statemachine.MCTS.manager.parameterstuning.structure;
import java.util.List;
/**
* This class is used by some tuners to keep track of the next combination to test for each role.
* This class (for now) is used by evolutionary tuners that evolve multiple populations (one for
* each ... | src/main/java/org/ggp/base/player/gamer/statemachine/MCTS/manager/parameterstuning/structure/CombosOfIndividualsIterator.java | 0.866514 | 0.54577 | CombosOfIndividualsIterator.java | starcoder |
package org.frcteam2910.common.math.spline;
import org.ejml.simple.SimpleMatrix;
import org.frcteam2910.common.math.Rotation2;
import org.frcteam2910.common.math.Vector2;
class HermiteSplineHelper {
/**
* Creates the basis weight matrix for a cubic hermite spline.
*
* @param start The positi... | common/src/main/java/org/frcteam2910/common/math/spline/HermiteSplineHelper.java | 0.902461 | 0.666746 | HermiteSplineHelper.java | starcoder |
package org.lucidant;
import java.util.Arrays;
import java.util.stream.IntStream;
/**
* Find and return the middle where the sum on the left is the same as the sum of the right.
*
* @author chrisfaulkner
*
*/
public class EqualSidesOfArray {
/**
* Find and return the middle where the sum on the left i... | src/main/java/org/lucidant/EqualSidesOfArray.java | 0.724968 | 0.560614 | EqualSidesOfArray.java | starcoder |
很清楚的DFS Backtracking.
在遍历str的时候,考虑从每个curr spot 到 str 结尾,是能有多少种palindorme?那就从curr spot当个字符开始算,开始back tracing.
如果所选不是palindrome, 那move on.
若所选的确是palindrome, 加到path里面,DFS去下个level,等遍历到了结尾,这就产生了一种分割成palindrome的串。
每次DFS结尾,要把这一层加的所选palindrome删掉,backtracking嘛。
```
/*
Given a string s, pa... | java/sha/Others/old records/LintCode-Backup/Palindrome Partitioning.java | 0.750461 | 0.870872 | Palindrome Partitioning.java | starcoder |
package eu.dkaratzas.starsgl.render;
import eu.dkaratzas.starsgl.Const;
@SuppressWarnings("ForLoopReplaceableByForEach")
public class GenerateVerticesData implements Runnable {
private final StarWarsRenderer mStarWarsRenderer;
public GenerateVerticesData(StarWarsRenderer starWarsRenderer) {
mStarWar... | starsgl/src/main/java/eu/dkaratzas/starsgl/render/GenerateVerticesData.java | 0.859221 | 0.412648 | GenerateVerticesData.java | starcoder |
package org.apache.commons.rng.core.source32;
import org.apache.commons.rng.core.util.NumberFactory;
/**
* This abstract class is a base for algorithms from the Xor-Shift-Rotate family of 32-bit
* generators with 64-bits of state.
*
* @see <a href="http://xoshiro.di.unimi.it/">xorshiro / xoroshiro generators</a>
... | subjects/components/code/commons-rng/commons-rng-core/src/main/java/org/apache/commons/rng/core/source32/AbstractXoRoShiRo64.java | 0.931509 | 0.405802 | AbstractXoRoShiRo64.java | starcoder |
package week8;
import java.util.Scanner;
/**
*
* @author christopher.eckles
*/
public class GeometricShapes {
private final static double PI = 3.1416;
public static void main(String[] args) {
//caculate cube volume
System.out.println("First, we'll caclulate the volume of a c... | src/week8/GeometricShapes.java | 0.511473 | 0.616849 | GeometricShapes.java | starcoder |
package android.renderscript;
import java.lang.reflect.Field;
import android.util.Log;
/**
* <p>The most basic data type. An element represents one cell of a memory allocation.
* Element is the basic data type of Renderscript. An element can be of two forms: Basic elements or Complex forms.
* Examples of basic ele... | android/upstream/android/renderscript/Element.java | 0.878887 | 0.612802 | Element.java | starcoder |
package uk.org.glendale.worldgen.astro.sectors;
import javax.persistence.*;
/**
* Defines a sector of space. A sector consists of a region 32 parsecs wide by 40 parsecs high.
* Location 0101 is the top left hex of the sector, and 3240 is the bottom right.
*
* Each sector is divided into 16 sub-sectors, labelled A... | src/main/java/uk/org/glendale/worldgen/astro/sectors/Sector.java | 0.920718 | 0.477981 | Sector.java | starcoder |
package net.loganford.noideaengine.utils.math;
import org.joml.Vector3d;
import org.joml.Vector3dc;
import org.joml.Vector3f;
import org.joml.Vector3fc;
public class MathUtils {
private static Vector3f V3F = new Vector3f();
private static Vector3f V3F_2 = new Vector3f();
private static Vector3d V3D = new ... | src/main/java/net/loganford/noideaengine/utils/math/MathUtils.java | 0.878959 | 0.828523 | MathUtils.java | starcoder |
package com.opengamma.financial.analytics.model.horizon;
import static com.opengamma.engine.value.ValuePropertyNames.CURVE_CALCULATION_CONFIG;
import static com.opengamma.engine.value.ValueRequirementNames.HISTORICAL_TIME_SERIES;
import static com.opengamma.financial.analytics.model.horizon.ThetaPropertyNamesAndValues... | projects/OG-Financial/src/main/java/com/opengamma/financial/analytics/model/horizon/SwapConstantSpreadThetaFunction.java | 0.612889 | 0.466116 | SwapConstantSpreadThetaFunction.java | starcoder |
package phys2d.entities;
import java.awt.Graphics2D;
import phys2d.Phys2DMain;
public class Vec2D {
public static final Vec2D ORIGIN = new Vec2D();
private double x;
private double y;
/**
* Initialize a vector to [0,0]
*/
public Vec2D() {
this(0, 0);
}
/**
* Ini... | src/phys2d/entities/Vec2D.java | 0.947684 | 0.686843 | Vec2D.java | starcoder |
public class NodeStack<Item> {
/**
* Entry point for the program.
*/
public static void main(String[] args) {
NodeStack<Integer> Stack = new NodeStack<Integer>();
Stack.push(3);
Stack.push(4);
Stack.push(5);
System.out.println("Testing :");
Stack.print()... | contribution/archieacharya/NodeStack.java | 0.637031 | 0.429848 | NodeStack.java | starcoder |
package com.davidbracewell.parsing;
import lombok.NonNull;
import java.util.*;
/**
* <p>Represents a stream of tokens from a Lexer.</p>
*
* @author <NAME>
*/
public class ParserTokenStream {
private final Iterator<ParserToken> tokenIterator;
private final LinkedList<ParserToken> buffer;
private ParserT... | src/main/java/com/davidbracewell/parsing/ParserTokenStream.java | 0.906555 | 0.502869 | ParserTokenStream.java | starcoder |
import java.util.*;
public class Evaluator {
private Stack<Operand> operandStack;
private Stack<Operator> operatorStack;
private StringTokenizer tokenizer;
private static final String DELIMITERS = "+*-^/#!() ";
public Evaluator() {
operandStack = new Stack<>();
operatorStack ... | Assignment 1/src/Evaluator.java | 0.719088 | 0.434941 | Evaluator.java | starcoder |
package com.google.android.exoplayer2.audio;
import androidx.annotation.Nullable;
import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.util.MimeTypes;
/** Utility methods for handling MPEG audio streams. */
public final class MpegAudioUtil {
/** Stores the metadata for an MPEG audio frame. ... | library/common/src/main/java/com/google/android/exoplayer2/audio/MpegAudioUtil.java | 0.937726 | 0.463444 | MpegAudioUtil.java | starcoder |
package org.apache.mahout.cf.taste.impl.recommender.svd;
import com.google.common.collect.Lists;
import org.apache.mahout.cf.taste.common.TasteException;
import org.apache.mahout.cf.taste.impl.common.FullRunningAverage;
import org.apache.mahout.cf.taste.impl.common.LongPrimitiveIterator;
import org.apache.mahout.cf.ta... | core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/svd/ALSWRFactorizer.java | 0.862656 | 0.401219 | ALSWRFactorizer.java | starcoder |
package com.dyh.algorithms4.chapter2;
/**
* author: dengyunhui
* datetime: 2021/6/30 21:26
* <p>
* 自顶向下的归并排序
* <p>
* 有以下优化点:
* 1. 对小规模子数组使用插入排序。
* <p>
* 2. 测试数组是否有序。
* 在递归的 sort 方法中,如果 a[mid] < a[mid + 1],我们可以认为数组已经是有序的并跳过 merge() 方法。
* 因为子数组是有序的,如果前半子数组的最大值都比后半子数组的最小值还小,那么就不需要 merge 了
* <p>
* 3.不将元素复制到辅助... | src/main/java/com/dyh/algorithms4/chapter2/Merge.java | 0.517327 | 0.543166 | Merge.java | starcoder |
package uk.co.terminological.costbenefit;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import org.apache.commons.collections4.iterators.PeekingIterator;
import org.apache.commons.math3.fitting.SimpleCurveFitter;
import org.apache.commons.math3.fitting.WeightedObservedPoints;
public... | costbenefit/src/main/java/uk/co/terminological/costbenefit/ClassifierResult.java | 0.661595 | 0.402099 | ClassifierResult.java | starcoder |
package net.openhft.chronicle.queue;
import net.openhft.chronicle.core.io.IORuntimeException;
import net.openhft.chronicle.wire.DocumentContext;
import net.openhft.chronicle.wire.MarshallableIn;
import net.openhft.chronicle.wire.ReadMarshallable;
import net.openhft.chronicle.wire.SourceContext;
import org.jetbrains.an... | src/main/java/net/openhft/chronicle/queue/ExcerptTailer.java | 0.889804 | 0.439206 | ExcerptTailer.java | starcoder |
package org.apache.commons.configuration2.tree;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
/**
* <p>
* A simple data class used by node models to store parameters of an update
* operation.
* </p>
* <p>
* The {@code Confi... | src/main/java/org/apache/commons/configuration2/tree/NodeUpdateData.java | 0.928059 | 0.567038 | NodeUpdateData.java | starcoder |
package com.ehu.util;
import java.math.BigDecimal;
import java.math.RoundingMode;
public class ArithUtils {
/**
* 默认除法运算精度
**/
private static final int DEF_DIV_SCALE = 10;
private ArithUtils() {
}
/**
* 提供精确的加法运算。
*
* @param v1 被加数
* @param v2 加数
* @return 两个参... | src/main/java/com/ehu/util/ArithUtils.java | 0.758153 | 0.452536 | ArithUtils.java | starcoder |
package com.stardust.autojs.core.image;
import android.graphics.Color;
/**
* Created by Stardust on 2017/5/20.
*/
public interface ColorDetector {
boolean detectsColor(int red, int green, int blue);
abstract class AbstractColorDetector implements ColorDetector {
protected final int mColor;
... | android/autojs/src/main/java/com/stardust/autojs/core/image/ColorDetector.java | 0.858437 | 0.535827 | ColorDetector.java | starcoder |
package edu.princeton.cs.algs4;
/**
* The {@code NFA} class provides a data type for creating a
* <em>nondeterministic finite state automaton</em> (NFA) from a regular
* expression and testing whether a given string is matched by that regular
* expression.
* It supports the following operations: <em>concaten... | src/main/java/edu/princeton/cs/algs4/NFA.java | 0.926984 | 0.65274 | NFA.java | starcoder |
package com.alexkasko.unsafe.offheapstruct;
import com.alexkasko.unsafe.offheap.OffHeapDisposableIterator;
import com.alexkasko.unsafe.offheap.OffHeapUtils;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.concurrent.Callable;
im... | src/main/java/com/alexkasko/unsafe/offheapstruct/OffHeapStructSorterWithComparator.java | 0.924688 | 0.404743 | OffHeapStructSorterWithComparator.java | starcoder |
package us.ihmc.mecano.fourBar;
import us.ihmc.euclid.geometry.Bound;
import us.ihmc.euclid.geometry.tools.EuclidGeometryTools;
import us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly;
/**
* {@link FourBar} implements the math for working with either a convex or a cross four bar linkage:
* <ul>
* <li>the full sta... | src/main/java/us/ihmc/mecano/fourBar/FourBar.java | 0.951774 | 0.691569 | FourBar.java | starcoder |
package com.fortify.util.rest.json;
import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Consumer;
import java.util.function.Supplier;
import org.apache.commons.collections.CollectionUtils;
import org.springfram... | common-rest/src/main/lombok/com/fortify/util/rest/json/JSONList.java | 0.952298 | 0.538316 | JSONList.java | starcoder |
package com.google.cloud.dataflow.sdk.transforms.windowing;
import org.apache.beam.sdk.annotations.Experimental;
import com.google.common.collect.Ordering;
import org.joda.time.Instant;
import java.io.Serializable;
import java.util.Objects;
/**
* <b><i>(Experimental)</i></b> A function from timestamps of input val... | sdks/java/core/src/main/java/com/google/cloud/dataflow/sdk/transforms/windowing/OutputTimeFn.java | 0.948106 | 0.624551 | OutputTimeFn.java | starcoder |
package xtc.parser;
import xtc.tree.Visitor;
/**
* Visitor to provide a conservative estimate for the cost of parsing
* a production. One unit of cost is approximately equivalent to the
* effort involved in parsing a character and testing it for a
* specific value. The cost estimate for a production includes th... | xtc/src/main/java/xtc/parser/CostEstimator.java | 0.891952 | 0.502625 | CostEstimator.java | starcoder |
package com.github.jxen.measure.system;
import static com.github.jxen.measure.dimension.Dimensions.DIMENSIONLESS;
import static com.github.jxen.measure.system.MetricUnits.SECOND;
import static com.github.jxen.measure.unit.UnitUtil.unit;
import com.github.jxen.measure.annotation.AddUnit;
import com.github.jxen.measure... | jxen-measure-core/src/main/java/com/github/jxen/measure/system/RadianUnits.java | 0.939741 | 0.500244 | RadianUnits.java | starcoder |
package org.apache.phoenix.end2end;
import static org.apache.phoenix.util.TestUtil.TEST_PROPERTIES;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.sql.Connection;
import j... | phoenix-core/src/it/java/org/apache/phoenix/end2end/BinaryRowKeyIT.java | 0.710628 | 0.401981 | BinaryRowKeyIT.java | starcoder |
package org.graalvm.compiler.asm;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Consumer;
import jdk.vm.ci.code.Register;
import jdk.vm.ci.code.StackSlot;
import jdk.vm.ci.code.TargetDescription;
/**
* The platform-independent base class... | src/src/org/graalvm/compiler/asm/Assembler.java | 0.884912 | 0.40642 | Assembler.java | starcoder |
package com.bastiaanjansen.otp;
import java.net.URI;
import java.net.URISyntaxException;
import java.time.Duration;
import java.time.Instant;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.TimeUnit;
/**
* Generates time-based one-time pas... | src/main/java/com/bastiaanjansen/otp/TOTP.java | 0.88063 | 0.40489 | TOTP.java | starcoder |
package org.chromium.mojo.bindings;
import android.test.suitebuilder.annotation.SmallTest;
import org.chromium.mojo.MojoTestCase;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
/**
* Testing {@link ValidationTestUtil}.
*/
public class ValidationTestUtilTest extends MojoTestCase {
/**
* Check th... | mojo/android/javatests/src/org/chromium/mojo/bindings/ValidationTestUtilTest.java | 0.860691 | 0.693421 | ValidationTestUtilTest.java | starcoder |
package TRAVERS;
import UserExp.Formats.PathFormat;
import Structures.graphModel;
import javafx.util.Pair;
import java.util.*;
public class FeatureGenerator
{
public Integer PathLen;
public Map<List<Integer>, Integer > RelationMap = new HashMap<>();
public List< List<Integer> > Relations = new ArrayList... | TRAVERS/TRAVERS/FeatureGenerator.java | 0.696784 | 0.513729 | FeatureGenerator.java | starcoder |
package QQPIM;
public final class ESmsAuditType {
public static final ESmsAuditType EMSAT_BLACK = new ESmsAuditType(3, 3, "EMSAT_BLACK");
public static final ESmsAuditType EMSAT_CHARGE_INTERCEPT = new ESmsAuditType(8, 8, "EMSAT_CHARGE_INTERCEPT");
public static final ESmsAuditType EMSAT_CONTENT_TOO_SHORT =... | sample4/recompiled_java/sources/QQPIM/ESmsAuditType.java | 0.707607 | 0.474936 | ESmsAuditType.java | starcoder |
package com.andremanuelbarbosa.euromillions.predictor.domain;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.collect.Lists;
import java.util.*;
import static com.andremanuelbarbosa.euromillions.predictor.EuroMillionsPredictorPropert... | src/main/java/com/andremanuelbarbosa/euromillions/predictor/domain/Draw.java | 0.887125 | 0.410402 | Draw.java | starcoder |
package com.iluwatar.collectionpipeline;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Imperative-style programming to iterate over the list and get the names of cars made later than
* the year 2000... | collection-pipeline/src/main/java/com/iluwatar/collectionpipeline/ImperativeProgramming.java | 0.913857 | 0.482063 | ImperativeProgramming.java | starcoder |
public class RedBlackBST<Key extends Comparable<Key>, Value> {
private Node root;
private static final boolean RED = true;
private static final boolean BLACK = false;
private class Node {
Key key;
Value val;
Node left, right;
int N;
boolean color;
N... | chapter_3/RedBlackBST.java | 0.902736 | 0.409044 | RedBlackBST.java | starcoder |
package org.apache.poi.hssf.record;
import org.apache.poi.util.LittleEndian;
import java.util.ArrayList;
/**
* Title: Extended Static String Table<P>
* Description: This record is used for a quick lookup into the SST record. This
* record breaks the SST table into a set of buckets. The offsets... | sourcedata/poi-REL_2_5_1/src/java/org/apache/poi/hssf/record/ExtSSTRecord.java | 0.709221 | 0.413773 | ExtSSTRecord.java | starcoder |
package java.security;
import java.io.Serializable;
import java.security.cert.CertPath;
import java.util.Date;
/**
* {@code Timestamp} represents a signed time stamp. {@code Timestamp} is
* immutable.
*/
public final class Timestamp implements Serializable {
private static final long serialVersionUID = -55026... | third_party/android/platform-libcore/android-platform-libcore/luni/src/main/java/java/security/Timestamp.java | 0.960231 | 0.453443 | Timestamp.java | starcoder |
package de.jtem.numericalMethods.geometry.mesh;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import java.util.Vector;
/**
* This class represents an unoriented edge.
*
* It also... | libUnzipped/de/jtem/numericalMethods/geometry/mesh/Edge.java | 0.934873 | 0.646739 | Edge.java | starcoder |
package org.openstreetmap.atlas.checks.validation.relations;
import org.openstreetmap.atlas.geography.atlas.Atlas;
import org.openstreetmap.atlas.utilities.testing.CoreTestRule;
import org.openstreetmap.atlas.utilities.testing.TestAtlas;
import org.openstreetmap.atlas.utilities.testing.TestAtlas.Edge;
import org... | RouteRelationCheckTestRule.java | 0.551332 | 0.42185 | RouteRelationCheckTestRule.java | starcoder |
package jsr166e;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
/**
* One or more variables that together maintain a running {@code long} maximum
* with initial value {@code Long.MIN_VALUE}. When updates
* (method {@link #update}) are c... | concourse-server/src/main/java/jsr166e/LongMaxUpdater.java | 0.946769 | 0.430147 | LongMaxUpdater.java | starcoder |
package com.opengamma.financial.analytics.model.credit.isda.calibration;
import static com.opengamma.financial.analytics.model.credit.CreditInstrumentPropertyNamesAndValues.PROPERTY_SPREAD_CURVE_SHIFT;
import static com.opengamma.financial.analytics.model.credit.CreditInstrumentPropertyNamesAndValues.PROPERTY_SPREAD_C... | projects/OG-Financial/src/main/java/com/opengamma/financial/analytics/model/credit/isda/calibration/ISDACDXAsSingleNameHazardRateCurveFunction.java | 0.724383 | 0.596081 | ISDACDXAsSingleNameHazardRateCurveFunction.java | starcoder |
package org.awaitility.core;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.TimeUnit;
/**
* Handles the lifecycle of an executor service.
*
* <b>This is an internal class, never use it directly!!</b>
*
* @since 3.1.0
*/
public class ExecutorLifecycle {
private final Supplier<Execu... | awaitility/src/main/java/org/awaitility/core/ExecutorLifecycle.java | 0.856197 | 0.400544 | ExecutorLifecycle.java | starcoder |
package net.fabricmc.fabric.api.renderer.v1.mesh;
import org.jetbrains.annotations.Nullable;
import net.minecraft.client.render.model.BakedQuad;
import net.minecraft.client.texture.Sprite;
import net.minecraft.client.util.math.Vector3f;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.Vec2f;
... | fabric-renderer-api-v1/src/main/java/net/fabricmc/fabric/api/renderer/v1/mesh/MutableQuadView.java | 0.891292 | 0.477615 | MutableQuadView.java | starcoder |
package cgeo.geocaching.connector.gc;
import static org.assertj.core.api.Assertions.assertThat;
import cgeo.geocaching.SearchResult;
import cgeo.geocaching.connector.ConnectorFactory;
import cgeo.geocaching.connector.ConnectorFactoryTest;
import cgeo.geocaching.connector.trackable.TravelBugConnector;
import cgeo.geoc... | tests/src-android/cgeo/geocaching/connector/gc/GCConnectorTest.java | 0.760473 | 0.550849 | GCConnectorTest.java | starcoder |
package org.lwjgl.opengl;
import java.nio.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.Checks.*;
import static org.lwjgl.system.JNI.*;
import static org.lwjgl.system.MemoryStack.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* Native bindings to the <a href="http://www.opengl.org/registry/spec... | Dependencies/opengl/src/org/lwjgl/opengl/ARBTextureMultisample.java | 0.814607 | 0.690781 | ARBTextureMultisample.java | starcoder |
package io.vavr.collection;
import java.io.Serializable;
import java.util.NoSuchElementException;
import java.util.function.Function;
import java.util.function.Predicate;
import static java.util.function.Function.identity;
import static io.vavr.collection.ArrayType.obj;
import static io.vavr.collection.Collections.wi... | vavr/src/main/java/io/vavr/collection/BitMappedTrie.java | 0.936995 | 0.530966 | BitMappedTrie.java | starcoder |
package org.infinispan.util.concurrent;
import java.util.Objects;
import java.util.concurrent.Callable;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionException;
import java.util.concurrent.CompletionStage;
import java.util.concurrent.ExecutionException;
import java.util.concurren... | core/src/main/java/org/infinispan/util/concurrent/CompletionStages.java | 0.943374 | 0.53777 | CompletionStages.java | starcoder |
package com.beanit.openiec61850;
import com.beanit.openiec61850.internal.mms.asn1.AlternateAccessSelection;
import com.beanit.openiec61850.internal.mms.asn1.ObjectName;
import com.beanit.openiec61850.internal.mms.asn1.ObjectName.DomainSpecific;
import com.beanit.openiec61850.internal.mms.asn1.VariableDefs;
import java... | src/main/java/com/beanit/openiec61850/ServerModel.java | 0.843766 | 0.473536 | ServerModel.java | starcoder |
package net.jamu.matrix;
/**
* Build a <a href=https://en.wikipedia.org/wiki/Permutation_matrix>permutation
* matrix</a> from an array of pivot indexes (describing row interchanges) which
* gets returned by LAPACK methods like {@code ?getrf}.
* <p>
* For example, an {@code 'ipiv'} array {@code [2,2,2]} in ... | src/main/java/net/jamu/matrix/Permutation.java | 0.947405 | 0.712581 | Permutation.java | starcoder |
package android.support.v4.view;
import static android.os.Build.VERSION.SDK_INT;
import android.graphics.Rect;
import android.view.WindowInsets;
/**
* Describes a set of insets for window content.
*
* <p>WindowInsetsCompats are immutable and may be expanded to include more inset types in the
* future. To adjust ... | compat/java/android/support/v4/view/WindowInsetsCompat.java | 0.944613 | 0.563618 | WindowInsetsCompat.java | starcoder |
package org.jgrapht.alg;
import java.util.*;
import org.jgrapht.*;
import org.jgrapht.graph.*;
import org.jgrapht.traverse.*;
/**
* An implementation of <a href="http://mathworld.wolfram.com/DijkstrasAlgorithm.html">Dijkstra's
* shortest path algorithm</a> using <code>ClosestFirstIterator</code>.
*
* @param <V> ... | Optimal Delivery Route Finder/jgrapht-1.0.1/source/jgrapht-core/src/main/java/org/jgrapht/alg/DijkstraShortestPath.java | 0.951256 | 0.516108 | DijkstraShortestPath.java | starcoder |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.