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 chapter1.topic1;
/**
* 34. Find First and Last Position of Element in Sorted Array
*
* Given an array of integers nums sorted in ascending order, find the starting and ending position of a given target value.
*
* Your algorithm's runtime complexity must be in the order of O(log n).
*
* If the target is ... | src/main/java/chapter1/topic1/LeetCode_34.java | 0.852291 | 0.580798 | LeetCode_34.java | starcoder |
package az.adil.finance;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
/**
*
* @author <NAME>
*/
public class LuhnValidatorTest {
public LuhnValidatorTest() {
}
@BeforeClass
publ... | test/az/adil/finance/LuhnValidatorTest.java | 0.748904 | 0.623678 | LuhnValidatorTest.java | starcoder |
package pl.edu.pw.mini.gapso.bounds;
import pl.edu.pw.mini.gapso.configuration.BoundsManagerConfiguration;
import pl.edu.pw.mini.gapso.model.FullSquareModel;
import pl.edu.pw.mini.gapso.model.Model;
import pl.edu.pw.mini.gapso.model.SimpleSquareModel;
import pl.edu.pw.mini.gapso.optimizer.SamplingOptimizer;
import pl.... | gapso/src/main/java/pl/edu/pw/mini/gapso/bounds/GlobalModelBoundsManager.java | 0.791418 | 0.48054 | GlobalModelBoundsManager.java | starcoder |
package org.bytedeco.javacpp.indexer;
/**
* Provides an interface for classes that compute a linear index from given array sizes.
*
* @see OneIndex
* @see StrideIndex
* @see HyperslabIndex
*
* @author <NAME>
*/
public abstract class Index {
/** Returns {@code new OneIndex(size)}. */
public static Inde... | src/main/java/org/bytedeco/javacpp/indexer/Index.java | 0.959278 | 0.516778 | Index.java | starcoder |
package com.lmax.disruptor;
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
/**
* Cache line padded sequence counter.
*
* Can be used across threads without worrying about false sharing if a located adjacent to another counter in memory.
*/
public class Sequence
{
private static final AtomicLongFie... | src/main/java/com/lmax/disruptor/Sequence.java | 0.941244 | 0.439627 | Sequence.java | starcoder |
package io.github.abductcows.easyargs;
import java.util.HashMap;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.StringJoiner;
import static io.github.abductcows.easyargs.Utils.returnForFirstNonEmptyName;
import static io.github.abductcows.easyargs.Utils.runForNonEmptyNames;
/**
* Re... | src/main/java/io/github/abductcows/easyargs/ArgumentParserResult.java | 0.913793 | 0.400544 | ArgumentParserResult.java | starcoder |
package it.unive.lisa.analysis.dataflow;
import it.unive.lisa.analysis.SemanticEvaluator;
import it.unive.lisa.program.cfg.ProgramPoint;
import it.unive.lisa.symbolic.value.Identifier;
import it.unive.lisa.symbolic.value.ValueExpression;
import java.util.Collection;
/**
* An element of the dataflow domain, that is a... | lisa/src/main/java/it/unive/lisa/analysis/dataflow/DataflowElement.java | 0.690872 | 0.476945 | DataflowElement.java | starcoder |
package tw.com.jinnboy.javautil.util;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Regex {
private Regex() {
}
private static HashMap<String, Pattern> patterns = new HashMap<>();
public static Pattern pattern(String regex) {
... | src/main/java/tw/com/jinnboy/javautil/util/Regex.java | 0.644673 | 0.522689 | Regex.java | starcoder |
package symmetric_tree;
public class Solution {
public static void main(String[] args) {
TreeNode tree1 = new TreeNode(1);
TreeNode tree2 = new TreeNode(2);
TreeNode tree3 = new TreeNode(2);
TreeNode tree4 = new TreeNode(3);
TreeNode tree5 = new TreeNode(4);
TreeNo... | easy/src/main/java/symmetric_tree/Solution.java | 0.872782 | 0.565539 | Solution.java | starcoder |
package org.hipparchus.geometry.spherical.twod;
import org.hipparchus.geometry.euclidean.threed.Vector3D;
import org.hipparchus.geometry.partitioning.BSPTree;
/** Specialized version of {@link Edge} with tree node information.
* <p>
* The tree nodes information is used to set up connection between
* edges (i.e. co... | hipparchus-geometry/src/main/java/org/hipparchus/geometry/spherical/twod/EdgeWithNodeInfo.java | 0.952651 | 0.651195 | EdgeWithNodeInfo.java | starcoder |
import static org.junit.Assert.*;
import org.junit.Test;
public class EventTest {
@Test
public void testEvent() {
Event test = new Event();
boolean result = true;
result = result && test.classification.equals("PUBLIC");
result = result && test.version.equals("2.0");
result = resul... | software_engeering/ulu_calendar/src/EventTest.java | 0.799716 | 0.482551 | EventTest.java | starcoder |
package com.brainacad.module_1.LabWork_1_6;
/**
* Created by a.zemlyanskiy on 01.09.2016.
* Write a program, which finds in a given matrix the area of equal numbers. Here is one example with an area containing 7 elements with equal value of 1:
* <p>
* +----------------------------+
* | 1 | 1 | 1 | 3 | 4 |
* | 2 ... | src/com/brainacad/module_1/LabWork_1_6/Lab_Work_1_6_5.java | 0.700075 | 0.571587 | Lab_Work_1_6_5.java | starcoder |
package util;
import java.util.Comparator;
/**
* Class <code>Coordinate2D</code> abstract class for a point in 2 dimensional
* space in which dimension 0 is the x dimension and dimension 1 is the y
* dimension.
*
* @author "<NAME>" <<EMAIL>>
* @see Coordinate
*/
public abstract class Coordinate2D implements ... | java/src/util/Coordinate2D.java | 0.897235 | 0.412234 | Coordinate2D.java | starcoder |
package xm.math.huffman;
import java.util.*;
/**
* @author xuming
*/
public class Huffman {
public static Map<Character, Integer> statistics(char[] charArray) {
Map<Character, Integer> map = new HashMap<>();
for (char c : charArray) {
Character character = new Character(c);
... | src/main/java/xm/math/huffman/Huffman.java | 0.844345 | 0.404743 | Huffman.java | starcoder |
package com.swirlds.fchashmap;
import com.swirlds.common.FastCopyable;
import java.util.AbstractMap;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;
import java.util.Set;
/**
* A fast copyable hashmap that is also able to generate inverse mappings between a value and the set of all
* ke... | swirlds-fchashmap/src/main/java/com/swirlds/fchashmap/FCInvertibleHashMap.java | 0.923126 | 0.515071 | FCInvertibleHashMap.java | starcoder |
package com.google.security.cryptauth.lib.securemessage;
import static org.junit.Assert.assertThrows;
import com.google.security.cryptauth.lib.securemessage.CryptoOps.EncType;
import com.google.security.cryptauth.lib.securemessage.CryptoOps.SigType;
import java.util.Arrays;
import javax.crypto.KeyGenerator;
import j... | src/main/javatest/com/google/security/cryptauth/lib/securemessage/CryptoOpsTest.java | 0.851799 | 0.648244 | CryptoOpsTest.java | starcoder |
package com.lanterna.gui2;
import com.lanterna.TerminalPosition;
import com.lanterna.TerminalSize;
import java.util.List;
/**
* The default window manager implementation used by Lanterna. New windows will be generally added in a tiled manner,
* starting in the top-left corner and moving down-right as new windows a... | src/main/java/com/lanterna/gui2/DefaultWindowManager.java | 0.881908 | 0.44059 | DefaultWindowManager.java | starcoder |
package model;
import java.util.ArrayList;
import java.time.Duration;
import java.time.LocalDateTime;
/**
* @author <NAME>
*
*/
public class label {
private node node;
private ArrayList<connection<edge, Integer>> path;
private Duration duration;
private LocalDateTime start;
private LocalDateTime end;
priv... | src/model/label.java | 0.745584 | 0.409221 | label.java | starcoder |
package com.urx.core.search.query;
import static com.google.common.collect.Lists.newArrayList;
/**
* A builder class for constructing arbitrarily-complex search queries, whilst providing a level of type-safety to
* ensure [mostly] sane queries. This class should stay in lock-step with the API search operators.
*/
... | core/src/main/java/com/urx/core/search/query/QueryBuilder.java | 0.875282 | 0.432363 | QueryBuilder.java | starcoder |
package br.skylight.commons.infra;
import javax.vecmath.Vector3d;
import br.skylight.commons.Coordinates;
public class CoordinatesHelper {
//heading calculation
private static Coordinates h1 = new Coordinates(0,0,0);
private static Coordinates h2 = new Coordinates(0,0,0);
//distance calculation
... | src/skylight-commons-core/src/main/java/br/skylight/commons/infra/CoordinatesHelper.java | 0.891191 | 0.637539 | CoordinatesHelper.java | starcoder |
package money.portosim.containers.generic;
import java.util.Map;
public class NumericMap<K> extends TaggedMap<K, Double> implements AlgebraicComposableMap<K, Double> {
public NumericMap(Map<K, Double> m) {
super(m);
}
public NumericMap() {
super();
}
@Override
protected Obje... | src/main/java/money/portosim/containers/generic/NumericMap.java | 0.92183 | 0.499023 | NumericMap.java | starcoder |
package com.josedab.interviewbit.trees;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* Given a set... | src/main/java/com/josedab/interviewbit/trees/HotelReviews.java | 0.898603 | 0.707139 | HotelReviews.java | starcoder |
package uk.gov.hmcts.probate.functional.documents;
import net.serenitybdd.junit.spring.integration.SpringIntegrationSerenityRunner;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import uk.gov.hmcts.probate.model.ccd.raw.request.CaseData;
import java.io.IOException;
import java.time.... | src/functionalTest/java/uk/gov/hmcts/probate/functional/documents/GrantGenerationTests.java | 0.518302 | 0.428233 | GrantGenerationTests.java | starcoder |
package gov.nist.math.jampack;
/**
* Zdiagmat is a storage efficient representation of a complex diagonal matrix.
*
* @version Pre-alpha, 1999-02-24
* @author <NAME>
*/
public final class Zdiagmat {
/** The order of the matrix */
final int order;
/** The real part of the diagonal */
private dou... | src/main/java/gov/nist/math/jampack/Zdiagmat.java | 0.948034 | 0.589037 | Zdiagmat.java | starcoder |
package objects;
import org.jogamp.java3d.Appearance;
import org.jogamp.java3d.QuadArray;
import org.jogamp.java3d.Shape3D;
import org.jogamp.java3d.TransformGroup;
import org.jogamp.vecmath.Color3f;
import org.jogamp.vecmath.Point3f;
import org.jogamp.vecmath.Vector3f;
import appearances.MaterialFactory;
import appe... | src/objects/SimpleRoom.java | 0.771887 | 0.424591 | SimpleRoom.java | starcoder |
package org.anddev.andengine.entity.primitive;
import javax.microedition.khronos.opengles.GL10;
import org.anddev.andengine.collision.LineCollisionChecker;
import org.anddev.andengine.collision.ShapeCollisionChecker;
import org.anddev.andengine.engine.camera.Camera;
import org.anddev.andengine.entity.shape.GLSha... | decompiled_src/JDGui/org/anddev/andengine/entity/primitive/Line.java | 0.584983 | 0.412175 | Line.java | starcoder |
package edu.smu.tspell.wordnet.impl;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Encapsulates example sentences applicable to a synset and / or word sense.
*
* @author <NAME>
*/
public class ExampleSentences
{
/**
*... | PoemFeatureExtractor/src/edu/smu/tspell/wordnet/impl/ExampleSentences.java | 0.915075 | 0.40928 | ExampleSentences.java | starcoder |
package pl.grzegorz2047.openguild.cuboidmanagement;
import org.bukkit.Location;
import org.bukkit.util.Vector;
import java.util.Objects;
import java.util.UUID;
/**
* @author Grzegorz
*/
public class Cuboid {
private Location center;
private String owner;
private Location min;
private Location max;... | src/main/java/pl/grzegorz2047/openguild/cuboidmanagement/Cuboid.java | 0.69035 | 0.435181 | Cuboid.java | starcoder |
package com.lhkbob.entreri.property;
import java.util.Arrays;
import java.util.Map;
/**
* ReferenceMapProperty
* ====================
*
* ReferenceMapProperty is a Property implementation for storing maps of a particular element key type `K`
* and value type `V` with reference semantics. This means the Property ... | src/main/java/com/lhkbob/entreri/property/ReferenceMapProperty.java | 0.948167 | 0.512815 | ReferenceMapProperty.java | starcoder |
package ch.ethz.bhepp.hybridstochasticsimulation.outputs;
import static com.google.common.base.Preconditions.checkArgument;
import java.util.List;
import ch.ethz.bhepp.hybridstochasticsimulation.trajectories.FiniteTrajectory;
public class FiniteTrajectoryOutput implements OutputRecord {
private static final Strin... | HybridStochasticSimulation/src/ch/ethz/bhepp/hybridstochasticsimulation/outputs/FiniteTrajectoryOutput.java | 0.850763 | 0.482185 | FiniteTrajectoryOutput.java | starcoder |
package vectors;
import java.io.Serializable;
import java.util.Objects;
public class Vector2D implements Serializable, Comparable<Vector2D> {
private static final long serialVersionUID = 1L;
private static final Vector2D ZERO = new Vector2D(0, 0);
public final double x;
public final double y;
... | src/main/java/vectors/Vector2D.java | 0.945109 | 0.853608 | Vector2D.java | starcoder |
package com.tjhruska.mc.util;
import java.sql.ResultSet;
import java.sql.SQLException;
public class MultiArrayUtils {
/**
* Converts an array[] of object Doubles to primitives[].
* @param array
* @return double[]
*/
public static double[] toPrimitive(Double[] array){
double[] newArray = new doubl... | src/main/groovy/com/tjhruska/mc/util/MultiArrayUtils.java | 0.71413 | 0.484868 | MultiArrayUtils.java | starcoder |
package math;
public class Leetcode330PatchingArray {
/*
330. Patching Array
Given a sorted integer array nums and an integer n,
add/patch elements to the array such that
any number in the range [1, n] inclusive can be formed
by the sum of some elements in the array.
Return the minimum ... | arrows/src/main/java/math/Leetcode330PatchingArray.java | 0.665845 | 0.758443 | Leetcode330PatchingArray.java | starcoder |
package derpyenginecore.math;
public final class MatFactory{
private MatFactory(){
}
public static Mat4f indentity(){
return new Mat4f(1F);
}
public static Mat4f orthographic(final float left, final float right, final float bottom, final float top, final float ... | derpyenginecore/math/MatFactory.java | 0.766556 | 0.629405 | MatFactory.java | starcoder |
package dynamic_programming;
/**
* Created by gouthamvidyapradhan on 13/12/2017.
* Given an unsorted array of integers, find the number of longest increasing subsequence.
Example 1:
Input: [1,3,5,4,7]
Output: 2
Explanation: The two longest increasing subsequence are [1, 3, 4, 7] and [1, 3, 5, 7].
Example 2:
I... | java/tag/dynamic_programming/NumberOfLIS.java | 0.838548 | 0.592873 | NumberOfLIS.java | starcoder |
package com.basdado.trainfinder.model;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import o... | src/main/java/com/basdado/trainfinder/model/OsmRailwayMap.java | 0.699254 | 0.408955 | OsmRailwayMap.java | starcoder |
package resource_exchange_arena;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.*;
public class ArenaEnvironment {
// Data that is collected over simulation runs is held within the aren... | resource_exchange_arena/ArenaEnvironment.java | 0.799129 | 0.520801 | ArenaEnvironment.java | starcoder |
package seedu.address.logic.parser;
import static java.util.Objects.requireNonNull;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import seedu.address.commons.core.index.Index;... | src/main/java/seedu/address/logic/parser/ParserUtil.java | 0.927466 | 0.402803 | ParserUtil.java | starcoder |
package com.pharmadm.num.dhb.DhbDataMining;
import com.pharmadm.num.dhb.DhbMatrixAlgebra.SymmetricMatrix;
import com.pharmadm.num.dhb.DhbMatrixAlgebra.DhbIllegalDimension;
import com.pharmadm.num.dhb.DhbMatrixAlgebra.DhbNonSymmetricComponents;
/**
* Statistical average and covariance for vectors
*
* @author <NAME>... | pharmadm-num/src/com/pharmadm/num/dhb/DhbDataMining/CovarianceAccumulator.java | 0.771499 | 0.421076 | CovarianceAccumulator.java | starcoder |
package de.fuberlin.wiwiss.d2rq.algebra;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Set;
import junit.framework.TestCase;
import de.fuberlin.wiwiss.d2rq.algebra.AliasMap.Alias;
import de.fuberlin.wiwiss.d2rq.expr.SQLExpression;
/**
* @author <NAME> (<EMAI... | test/de/fuberlin/wiwiss/d2rq/algebra/AliasMapTest.java | 0.748812 | 0.522324 | AliasMapTest.java | starcoder |
package org.hipparchus.special.elliptic.carlson;
import org.hipparchus.CalculusFieldElement;
import org.hipparchus.complex.Complex;
import org.hipparchus.complex.FieldComplex;
import org.hipparchus.util.FastMath;
/** Duplication algorithm for Carlson R<sub>C</sub> elliptic integral.
* @param <T> type of the field el... | hipparchus-core/src/main/java/org/hipparchus/special/elliptic/carlson/RcFieldDuplication.java | 0.9255 | 0.433142 | RcFieldDuplication.java | starcoder |
package org.sosy_lab.common;
import static com.google.common.truth.Truth.assertThat;
import com.google.common.collect.ImmutableList;
import java.io.FileNotFoundException;
import java.io.IOException;
import org.junit.Test;
public class ClassesTest {
private static void assertIsAllowed(
Iterable<Class<?>> dec... | src/org/sosy_lab/common/ClassesTest.java | 0.860457 | 0.501282 | ClassesTest.java | starcoder |
package com.epi;
import com.epi.BinaryTreePrototypeTemplate.BinaryTreeNode;
public class BalancedBinaryTree {
// @include
private static class BalanceStatusWithHeight {
public boolean balanced;
public int height;
public BalanceStatusWithHeight(boolean balanced, int height) {
this.balanced = bal... | java/src/main/java/com/epi/BalancedBinaryTree.java | 0.794863 | 0.403449 | BalancedBinaryTree.java | starcoder |
package pro.chenggang.project.reactive.mybatis.support.r2dbc.dynamic;
import org.apache.ibatis.annotations.SelectProvider;
import org.mybatis.dynamic.sql.select.render.SelectStatementProvider;
import org.mybatis.dynamic.sql.util.SqlProviderAdapter;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono... | mybatis-r2dbc/src/main/java/pro/chenggang/project/reactive/mybatis/support/r2dbc/dynamic/CommonSelectMapper.java | 0.829906 | 0.662974 | CommonSelectMapper.java | starcoder |
package com.google.zxing.client.android;
public final class R {
private R() {}
public static final class attr {
private attr() {}
public static final int zxing_possible_result_points = 0x7f030116;
public static final int zxing_result_view = 0x7f030117;
public static final int ... | app/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r/com/google/zxing/client/android/R.java | 0.572842 | 0.47658 | R.java | starcoder |
package asmcup.compiler;
import org.junit.Before;
import org.junit.Test;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import static org.junit.Assert.*;
public class CompilerTest {
private Compiler compiler = null;
@Before
public void setUp() {
compiler = new Compiler();
compi... | test/asmcup/compiler/CompilerTest.java | 0.726134 | 0.410225 | CompilerTest.java | starcoder |
package subway.domain;
import java.util.ArrayList;
import java.util.List;
public class SectionRepository {
private static List<Section> sectionList = new ArrayList<>();
static {
sectionList.add(new Section(new Station("교대역"), new Station("강남역"), 2, 3));
sectionList.add(new Section(new Station("강남역"), new Stati... | src/main/java/subway/domain/SectionRepository.java | 0.577734 | 0.408395 | SectionRepository.java | starcoder |
package hr.fer.zemris.irg.models;
import com.jogamp.opengl.GL;
import com.jogamp.opengl.GL2;
import hr.fer.zemris.irg.algortihms.CohenSutherland;
import hr.fer.zemris.irg.algortihms.ILineClipper;
import hr.fer.zemris.irg.zad3.IDrawable;
import lombok.Getter;
import java.awt.Point;
import java.awt.Color;
import java.u... | src/main/java/hr/fer/zemris/irg/models/Line.java | 0.58676 | 0.422207 | Line.java | starcoder |
package org.rcsb.cif.binary.codec;
import org.rcsb.cif.binary.data.EncodedDataFactory;
import org.rcsb.cif.binary.data.Int32Array;
import org.rcsb.cif.binary.data.IntArray;
import org.rcsb.cif.binary.encoding.Encoding;
import org.rcsb.cif.binary.encoding.RunLengthEncoding;
import java.util.LinkedList;
/**
* <p>Repr... | src/main/java/org/rcsb/cif/binary/codec/RunLengthCodec.java | 0.875601 | 0.408218 | RunLengthCodec.java | starcoder |
*
* Date: 24/08/2016
*
* Hacker rank
* 101 Hack Aug 2016
* Problem: Designer PDF Viewer
* Status: accepted
*
* When you select a contiguous block of text in a PDF viewer,
* the selection is highlighted with a blue rectangle. In a new
* kind of PDF viewer, the selection of each word is independent
* of... | java/hackerrank/src/main/java/com/vaani/hackerrank/hackathon/hack101/_2016/aug/Designer_PDF_Viewer.java | 0.850407 | 0.45538 | Designer_PDF_Viewer.java | starcoder |
package ivorius.pandorasbox.effects;
import ivorius.pandorasbox.PandorasBoxHelper;
import ivorius.pandorasbox.entitites.EntityPandorasBox;
import ivorius.pandorasbox.utils.PBNBTHelper;
import ivorius.pandorasbox.weighted.WeightedBlock;
import net.minecraft.block.Block;
import net.minecraft.nbt.NBTTagCompound;
import n... | src/main/java/ivorius/pandorasbox/effects/PBEffectGenShapes.java | 0.669205 | 0.41947 | PBEffectGenShapes.java | starcoder |
package com.android.car.ui.recyclerview;
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.Mockito.verify;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.RecyclerView.Adapter;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mo... | car-ui-lib/src/androidTest/java/com/android/car/ui/recyclerview/RangeFilterImplTest.java | 0.906405 | 0.493592 | RangeFilterImplTest.java | starcoder |
package com.algorithms.linkedlist.doubly;
/**
* This class implements all the desirable properties of a doubly liked list.
*/
public class DoublyLinkedList<T> implements LinkedList<T> {
// Points at the head of the list
private Node<T> head;
// Points at the tail of the list. This pointer ensures thatwe dont h... | linkedlist/src/main/java/com/algorithms/linkedlist/doubly/DoublyLinkedList.java | 0.862699 | 0.409103 | DoublyLinkedList.java | starcoder |
package bt.torrent;
import bt.torrent.CoverMe;
import bt.torrent.selector.PackedIntComparator;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashSet;
import java.util.PriorityQueue;
import java.util.Random;
import java.util.Set;
import java.util.function.Predicate;
/**
* Implements the "rar... | bt-core/src/main/java/bt/torrent/RarestFirstSelectionStrategy.java | 0.846483 | 0.453322 | RarestFirstSelectionStrategy.java | starcoder |
package org.flowable.dmn.xml.converter;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import org.flowable.dmn.model.Decision;
import org.flowable.dmn.model.DiEdge;
import org.flowable.dmn.model.DmnDefinition;
import org.flowable.dmn.model.DmnDiDiagram;
import... | modules/flowable-dmn-xml-converter/src/main/java/org/flowable/dmn/xml/converter/ConversionHelper.java | 0.847905 | 0.738103 | ConversionHelper.java | starcoder |
package org.benoitdubreuil.iree.model;
import org.benoitdubreuil.iree.utils.MathUtils;
/**
* The image data for the image recognition by equilateral encoding.
* <p>
* See the author <NAME> of this algorithm and his book that contains everything about it :
* <a href="https://www.heatonresearch.com/book/aifh-vol1-f... | src/org/benoitdubreuil/iree/model/EquilateralEncodingTable.java | 0.917838 | 0.525186 | EquilateralEncodingTable.java | starcoder |
package design.unstructured.stix.evaluator.grammar;
import org.antlr.v4.runtime.tree.AbstractParseTreeVisitor;
/**
* This class provides an empty implementation of {@link StixPatternVisitor},
* which can be extended to create a visitor which only needs to handle a subset
* of the available methods.
*
* @param <T... | src/main/java/design/unstructured/stix/evaluator/grammar/StixPatternBaseVisitor.java | 0.9494 | 0.47591 | StixPatternBaseVisitor.java | starcoder |
package org.apache.mahout.math;
import java.util.Arrays;
/** Matrix of doubles implemented using a 2-d array */
public class DenseMatrix extends AbstractMatrix {
protected double[][] values;
public DenseMatrix() {
super();
}
protected int columnSize() {
return values[0].length;
}
prote... | math/src/main/java/org/apache/mahout/math/DenseMatrix.java | 0.927075 | 0.644309 | DenseMatrix.java | starcoder |
package kendzi.math.geometry.point;
import java.util.ArrayList;
import java.util.List;
import javax.vecmath.Point2d;
import javax.vecmath.Vector2d;
import org.ejml.simple.SimpleMatrix;
/**
*
* @see http://en.wikipedia.org/wiki/Transformation_matrix
* @see http://pl.wikipedia.org/wiki/Elementarne_mac... | kendzi-math-geometry/src/main/java/kendzi/math/geometry/point/TransformationMatrix2d.java | 0.8474 | 0.525247 | TransformationMatrix2d.java | starcoder |
package mcjty.rftoolsdim.dimensions.dimlets;
import mcjty.rftoolsdim.config.MobConfiguration;
import mcjty.rftoolsdim.dimensions.description.MobDescriptor;
import mcjty.rftoolsdim.dimensions.description.SkyDescriptor;
import mcjty.rftoolsdim.dimensions.description.WeatherDescriptor;
import mcjty.rftoolsdim.dimensions.... | src/main/java/mcjty/rftoolsdim/dimensions/dimlets/DimletObjectMapping.java | 0.591605 | 0.469459 | DimletObjectMapping.java | starcoder |
package com.solution.onequestionperday.may2021.maximumxoroftwonumbersinanarray421;
/**
* @ClassName MaximumXOROfTwoNumbersInAnArray
* @Description 421. Maximum XOR of Two Numbers in an Array
* Given an integer array nums, return the maximum result of nums[i] XOR nums[j], where 0 ≤ i ≤ j < n.
* <p>
* Follow up: Co... | src/com/solution/onequestionperday/may2021/maximumxoroftwonumbersinanarray421/MaximumXOROfTwoNumbersInAnArray.java | 0.876529 | 0.436082 | MaximumXOROfTwoNumbersInAnArray.java | starcoder |
package ca.on.oicr.gsi.shesmu.pinery.barcodes;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import org.apache.commons.text.similarity.HammingDistance;
import org.apache.commons.text.similarity.LevenshteinDistance;
/** @author mlaszloffy */
public class BarcodeComparison {
private st... | plugin-pinery/src/main/java/ca/on/oicr/gsi/shesmu/pinery/barcodes/BarcodeComparison.java | 0.888245 | 0.507019 | BarcodeComparison.java | starcoder |
package Engine.src.EngineData.Components;
import java.util.ArrayList;
import java.util.List;
/**
* Component that keeps track of the possible states of an EngineInstance
* @author <NAME>
*/
public class StateComponent extends Component {
private List<String> myStates;
private String myCurrState;
/**
... | src/Engine/src/EngineData/Components/StateComponent.java | 0.877857 | 0.523238 | StateComponent.java | starcoder |
package com.christianheina.communication.javafied.signalprocessing.data;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.math3.complex.Complex;
import org.jtransforms.fft.DoubleFFT_1D;
/**
* Class for handling frequency domain signals.
*
* @author <NAME> (<EMAIL>)
*/
public class Fr... | src/main/java/com/christianheina/communication/javafied/signalprocessing/data/FrequencyDomainSignal.java | 0.894663 | 0.45181 | FrequencyDomainSignal.java | starcoder |
package com.cloudbees.diff;
import java.io.Serializable;
/**
* This class represents a single difference between two files.
*
* @author <NAME>
*/
public class Difference implements Serializable {
/**
* Delete type of difference - a portion of a file was removed in the other
*/
public static fin... | buildSrc/src/main/java/com/cloudbees/diff/Difference.java | 0.895688 | 0.538073 | Difference.java | starcoder |
package zana.java.data;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.google.common.collect.ImmutableMap;
//----------------------------------------------------------------
/** AKA one-hot encoding.
*
* Maps each of <code>n</code> distinct
* values of a... | src/main/java/zana/java/data/CategoricalEmbedding.java | 0.950296 | 0.515254 | CategoricalEmbedding.java | starcoder |
package science.atlarge.granula.modeller.rule.visual;
import science.atlarge.granula.modeller.platform.operation.Operation;
import science.atlarge.granula.modeller.platform.visual.TimeSeriesVisual;
import science.atlarge.granula.modeller.entity.BasicType;
import science.atlarge.granula.modeller.platform.info.TimeSerie... | granula-modeller/src/main/java/science/atlarge/granula/modeller/rule/visual/EnvTimeSeriesVisualization.java | 0.664649 | 0.452113 | EnvTimeSeriesVisualization.java | starcoder |
package com.teamten.typeset;
/**
* Describes the number and sizes of columns.
*/
public class ColumnLayout {
private final int mColumnCount;
private final long mColumnWidth;
private final long mMargin;
/**
* Create a new column layout.
*
* @param columnCount the number of columns.
... | src/main/java/com/teamten/typeset/ColumnLayout.java | 0.943093 | 0.547525 | ColumnLayout.java | starcoder |
package soya.lang;
import java.lang.*;
import java.lang.Double;
import java.math.BigDecimal;
/**
* Float, equals to java.lang.Float and java.lang.Double on JVM.
* @author: <NAME>
*/
public class Float extends AbstractObject implements Comparable {
private double value;
public Float(float value) {
... | src/main/soya/lang/Float.java | 0.912258 | 0.549882 | Float.java | starcoder |
The Doclet API (also called the Javadoc API) provides a mechanism
for clients to inspect the source-level structure of programs and
libraries, including javadoc comments embedded in the source.
This is useful for documentation, program checking, automatic
code generation and many other tools.
<p>
Doclets are invoked b... | src/org/example/source/com/sun/javadoc/package-info.java | 0.835416 | 0.556701 | package-info.java | starcoder |
package com.adventofcode.year2019;
import com.adventofcode.Intcode;
import it.unimi.dsi.fastutil.longs.LongArrayList;
import it.unimi.dsi.fastutil.longs.LongList;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Objec... | src/main/java/com/adventofcode/year2019/Day23.java | 0.802556 | 0.515132 | Day23.java | starcoder |
package com.ali.me.problem;
import com.ali.me.cost.action.ActionCost;
import com.ali.me.cost.heuristic.Heuristic;
import com.ali.me.state.State;
import java.util.List;
/**
* This class describes the structure of a Problem. Implementing Sub-classes
* must implement and define the behaviour of each of the below abst... | src/com/ali/me/problem/Problem.java | 0.898014 | 0.478163 | Problem.java | starcoder |
package stylist.value;
import static stylist.Vendor.*;
import static stylist.value.Unit.*;
import java.util.EnumSet;
import stylist.CSSValue;
import stylist.Vendor;
public class Numeric extends CSSValue {
/** The zero value. */
public static final Numeric Zero = new Numeric(0, px);
/** ... | src/main/java/stylist/value/Numeric.java | 0.883267 | 0.528108 | Numeric.java | starcoder |
package Util;
/**
* <p> the vector class holds a double array of components </p>
*
* @author Danny
*
*/
public class Vector
{
private double[] components;
/** <p> constructor initializes the vector's "component" array </p>
*
* @param components
*/
public Vector( double ... components )
{
this.setC... | src/Util/Vector.java | 0.842992 | 0.457016 | Vector.java | starcoder |
package bits.draw3d.camera;
import bits.draw3d.Rect;
import bits.math3d.Mat;
import bits.math3d.Mat4;
public class CenteredOrthoFunc implements ProjectionFunc {
private float mNearPlane = -1f;
private float mFarPlane = 1f;
private float mHeight = 1f;
private float mAspectScale = 1f;
... | src/main/java/bits/draw3d/camera/CenteredOrthoFunc.java | 0.799521 | 0.425605 | CenteredOrthoFunc.java | starcoder |
package com.ciaoshen.leetcode;
import java.util.*;
import com.ciaoshen.leetcode.myUtils.*;
/**
* Each problem is initialized with 3 solutions.
* You can expand more solutions.
* Before using your new solutions, don't forget to register them to the solution registry.
*/
class TopKFrequentElements implements Prob... | java/src/main/java/com/ciaoshen/leetcode/TopKFrequentElements.java | 0.803212 | 0.439507 | TopKFrequentElements.java | starcoder |
package gov.nasa.jpf.symbc.veritesting.RangerDiscovery.Statistics;
import gov.nasa.jpf.symbc.veritesting.RangerDiscovery.Util.DiscoveryUtil;
import jkind.lustre.*;
import jkind.lustre.visitors.ExprVisitor;
import java.util.List;
/**
* This counts the expression size in two mode. The first mode if we have booleanNod... | src/main/gov/nasa/jpf/symbc/veritesting/RangerDiscovery/Statistics/ExprSizeVisitor.java | 0.857291 | 0.476458 | ExprSizeVisitor.java | starcoder |
package artisynth.tools.rotation;
import maspack.matrix.Matrix2d;
import maspack.matrix.Matrix3d;
import maspack.matrix.MatrixNd;
import maspack.matrix.Point3d;
import maspack.matrix.SVDecomposition3d;
import maspack.matrix.Vector2d;
import maspack.matrix.Vector3d;
import maspack.spatialmotion.Twist;
/**
* Computes ... | src/artisynth/tools/rotation/PlaneProjectionRotationAxis.java | 0.77081 | 0.486332 | PlaneProjectionRotationAxis.java | starcoder |
package stallone.api.datasequence;
import java.io.IOException;
import java.util.List;
import stallone.api.doubles.IDoubleArray;
/**
*
* Interface for loaders that retrieve DataSequences (e.g. trajectories)
* from file systems or data bases. Shields the usage of this data from the
* file / database access in order... | src/stallone/api/datasequence/IDataInput.java | 0.841011 | 0.435481 | IDataInput.java | starcoder |
package org.isaacphysics.graphchecker.features;
import org.isaacphysics.graphchecker.geometry.SectorBuilder;
import org.isaacphysics.graphchecker.data.HumanNamedEnum;
import org.isaacphysics.graphchecker.data.Line;
import org.isaacphysics.graphchecker.data.Point;
import org.isaacphysics.graphchecker.data.PointOfIntere... | library/src/main/java/org/isaacphysics/graphchecker/features/SymmetryFeature.java | 0.870267 | 0.495911 | SymmetryFeature.java | starcoder |
package jet.opengl.demos.os;
import org.lwjgl.util.vector.Matrix4f;
import org.lwjgl.util.vector.Vector3f;
import java.io.IOException;
import jet.opengl.postprocessing.buffer.AttribDesc;
import jet.opengl.postprocessing.buffer.BufferBinding;
import jet.opengl.postprocessing.buffer.BufferGL;
import jet.opengl.postpro... | testframewok/src/main/java/jet/opengl/demos/os/OSRenderer.java | 0.586404 | 0.509947 | OSRenderer.java | starcoder |
package com.github.owlcs.map;
import com.github.owlcs.ontapi.jena.model.OntModel;
import org.apache.jena.graph.Graph;
import org.apache.jena.rdf.model.Model;
import org.apache.jena.rdf.model.Resource;
import org.apache.jena.shared.PrefixMapping;
import java.util.Objects;
import java.util.stream.Stream;
/**
* A Mapp... | src/main/java/com/github/owlcs/map/MapManager.java | 0.941223 | 0.450601 | MapManager.java | starcoder |
package net.vnguyen.Model;
import org.jbox2d.collision.shapes.CircleShape;
import org.jbox2d.collision.shapes.PolygonShape;
import org.jbox2d.common.Vec2;
import org.jbox2d.dynamics.*;
import org.jbox2d.dynamics.joints.RevoluteJoint;
import org.jbox2d.dynamics.joints.RevoluteJointDef;
import java.util.ArrayList;
impo... | jbox2d-testbed/src/main/java/net/vnguyen/Model/CarShape.java | 0.610802 | 0.535098 | CarShape.java | starcoder |
package com.Jump.vikingJump;
/* renamed from: com.Jump.vikingJump.R */
public final class C0154R {
/* renamed from: com.Jump.vikingJump.R$attr */
public static final class attr {
public static final int adSize = 2130771968;
public static final int adSizes = 2130771969;
public static fi... | android.vikinghorde/dump_jadx/sources/com/Jump/vikingJump/C0154R.java | 0.655887 | 0.45181 | C0154R.java | starcoder |
package frc.vision;
/*
Camera Vision Process identifies the target and its position with respect to the camera.
It produces an angle of deviation between the camera and target and distance to the target.
Those data are presented in visual form on the Shuffleboard and are available programmatically
for automated... | src/main/java/frc/vision/Vision.java | 0.813016 | 0.872021 | Vision.java | starcoder |
package com.iiitd.dsavisualizer.datastructures.graphs;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Map;
import java.util.Stack;
// This class is used to hold extra animation data for an instance of a gra... | app/src/main/java/com/iiitd/dsavisualizer/datastructures/graphs/GraphAnimationStateExtra.java | 0.879471 | 0.42054 | GraphAnimationStateExtra.java | starcoder |
package simulation;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.jacop.constraints.Constraint;
import org.jacop.constraints.XltY;
import org.jacop.core.IntVar;
import org.jacop.core.Store;
public class CSPPath {
/**
* Assigned this.numTimePoints and... | leaf-analysis/src/simulation/CSPPath.java | 0.654895 | 0.438124 | CSPPath.java | starcoder |
package us.ihmc.quadrupedFootstepPlanning.pawPlanning.turnWalkTurn;
import us.ihmc.commons.MathTools;
import us.ihmc.commons.lists.RecyclingArrayList;
import us.ihmc.euclid.referenceFrame.FramePoint3D;
import us.ihmc.euclid.referenceFrame.FramePose2D;
import us.ihmc.euclid.referenceFrame.FramePose3D;
import us.ihmc.eu... | ihmc-quadruped/src/footstep-planning/java/us/ihmc/quadrupedFootstepPlanning/pawPlanning/turnWalkTurn/QuadrupedXGaitStepCalculator.java | 0.81571 | 0.726523 | QuadrupedXGaitStepCalculator.java | starcoder |
package jsat.datatransform;
import java.util.Arrays;
import jsat.DataSet;
import jsat.classifiers.CategoricalData;
import jsat.classifiers.DataPoint;
import jsat.linear.DenseVector;
import jsat.linear.Vec;
/**
* This transform converts numerical features into categorical ones via a simple
* histogram. Bins will be ... | jsat/src/main/java/jsat/datatransform/NumericalToHistogram.java | 0.91714 | 0.711907 | NumericalToHistogram.java | starcoder |
package edu.ie3.util;
import org.apache.commons.math3.complex.Complex;
/**
* Contains convenience methods for arrays
*
* @author roemer
*/
public class ArrayHelper {
private static final String ARRAY_DIMENSION_MISMATCH_MESSAGE =
"Both arrays may have the same dimension.";
private ArrayHelper() {}
/*... | src/main/java/edu/ie3/util/ArrayHelper.java | 0.945399 | 0.525917 | ArrayHelper.java | starcoder |
package org.apache.commons.lang;
import java.lang.reflect.Array;
/**
* <p>Operations on arrays, primitive arrays (like {@code int[]}) and
* primitive wrapper arrays (like {@code Integer[]}).</p>
*
* <p>This class tries to handle {@code null} input gracefully.
* An exception will not be thrown for a {@code null}
... | app/src/main/java/org/apache/commons/lang/ArrayUtils.java | 0.937697 | 0.457318 | ArrayUtils.java | starcoder |
package org.rnorth.visibleassertions;
import org.hamcrest.Description;
import org.hamcrest.Matcher;
import org.hamcrest.StringDescription;
import java.util.concurrent.Callable;
import static org.rnorth.ansi.AnsiLite.*;
/**
* Assertions for use in Java tests, with contextual information on each assertion performed.... | src/main/java/org/rnorth/visibleassertions/VisibleAssertions.java | 0.929776 | 0.496094 | VisibleAssertions.java | starcoder |
package org.jitsi.impl.neomedia.codec.audio.silk;
import java.lang.reflect.Array;
import org.jitsi.impl.neomedia.device.DeviceConfiguration;
import org.jitsi.impl.neomedia.portaudio.Pa;
public class PitchAnalysisCoreFLP {
static final /* synthetic */ boolean $assertionsDisabled = (!PitchAnalysisCoreFLP.class.desi... | doc/libjitisi/sources/org/jitsi/impl/neomedia/codec/audio/silk/PitchAnalysisCoreFLP.java | 0.680772 | 0.483039 | PitchAnalysisCoreFLP.java | starcoder |
package com.esferixis.geometry.plane.finite;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import com.esferixis.geometry.plane.Line;
import com.esferixis.geometry.plane.S... | MasterProject/src/com/esferixis/geometry/plane/finite/FiniteProportionalHolomorphicShapeGroup.java | 0.752922 | 0.467089 | FiniteProportionalHolomorphicShapeGroup.java | starcoder |
package uk.org.rivernile.android.fetchutils.loaders;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
/**
* Loaders can only return a single object. The purpose of this class is to encapsulate a success
* condition or a failure condition in to a single object that is returnable... | library/src/main/java/uk/org/rivernile/android/fetchutils/loaders/Result.java | 0.935332 | 0.417628 | Result.java | starcoder |
package Network.Learning.Propagation;
import Network.Calculation.LayerResult;
import Network.Layer.Layer;
import Network.SeviException;
import org.apache.commons.math3.complex.Complex;
import org.apache.commons.math3.linear.FieldMatrix;
import org.apache.commons.math3.linear.FieldVector;
/**
* Created by Severin on ... | src/main/java/Network/Learning/Propagation/LayerPropagation.java | 0.551815 | 0.507568 | LayerPropagation.java | starcoder |
package mm.structures;
import java.util.Arrays;
public class ColorPixel {
private static final String MARKER = ", \"markerColor\": \"#7C078E\", \"markerType\": \"circle\", \"markerSize\": 10";
private int code;
private int count;
private double probability;
private java.awt.Color color;
pu... | src/main/java/mm/structures/ColorPixel.java | 0.87864 | 0.587144 | ColorPixel.java | starcoder |
package UnitParser;
/**Conversion factors relating each unit to the reference for the given type.**/
public class UnitConversionFactors
{
//--- Length
/**
Metre (m) conversion factor. SI length unit.
Reference point for all the length units.
**/
public final static double Metre = 1.0;
/**Ce... | all_code/UnitParser/src_Public/UnitParser/UnitConversionFactors.java | 0.849316 | 0.501404 | UnitConversionFactors.java | starcoder |
package marc.henrard.murisq.model.g2pp;
import java.util.Arrays;
import com.opengamma.strata.collect.ArgChecker;
import com.opengamma.strata.collect.array.DoubleArray;
import com.opengamma.strata.collect.array.DoubleMatrix;
import marc.henrard.murisq.model.hullwhite.HullWhiteOneFactorPiecewiseConstantFormulas;
/**
... | src/main/java/marc/henrard/murisq/model/g2pp/G2ppPiecewiseConstantFormulas.java | 0.881104 | 0.596374 | G2ppPiecewiseConstantFormulas.java | starcoder |
package com.twu.biblioteca;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
public class BibliotecaWithLoginTest {
private BibliotecaWithLogin biblioteca;
private Credentials credentials;
@Before
public void... | test/com/twu/biblioteca/BibliotecaWithLoginTest.java | 0.71103 | 0.40072 | BibliotecaWithLoginTest.java | starcoder |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.