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.studiomediatech.queryresponse;
import java.util.Collection;
import java.util.Iterator;
import java.util.function.Consumer;
import java.util.function.Supplier;
/**
* Providing the entry-point to the fluid builder for responses, through the {@link #respondTo(String)} method.
*
* <p>Building a response i... | src/main/java/com/studiomediatech/queryresponse/ResponseBuilder.java | 0.904793 | 0.537041 | ResponseBuilder.java | starcoder |
package org.chromium.content.browser;
import androidx.test.filters.SmallTest;
import org.junit.Assert;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.chromium.base.test.BaseJUnit4ClassRunner;
import org.chromium.blink.mojom.MessagePortDescriptor;
import org.chromium.mojo.M... | content/public/android/javatests/src/org/chromium/content/browser/AppWebMessagePortDescriptorTest.java | 0.799716 | 0.441372 | AppWebMessagePortDescriptorTest.java | starcoder |
package com.datastax.driver.core.policies;
import com.datastax.driver.core.Cluster;
import com.datastax.driver.core.Host;
import com.datastax.driver.core.HostDistance;
import com.datastax.driver.core.Statement;
import java.util.Collection;
import java.util.Iterator;
/**
* The policy that decides which Cassandra host... | driver-core/src/main/java/com/datastax/driver/core/policies/LoadBalancingPolicy.java | 0.900137 | 0.437763 | LoadBalancingPolicy.java | starcoder |
package com.bluegosling.tuples;
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 static org.junit.Assert.fail;
import org.junit.Test;
import java.io.ByteArrayInputStream;
import... | test/com/bluegosling/tuples/TripleTest.java | 0.906789 | 0.728447 | TripleTest.java | starcoder |
package it.unimi.dsi.fastutil.ints;
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.util.Arrays;
import java.util.Random;
import org.junit.Test;
public class IntArraysTes... | test/it/unimi/dsi/fastutil/ints/IntArraysTest.java | 0.692746 | 0.665533 | IntArraysTest.java | starcoder |
package Array;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
public class IntersectionSortedArray {
//Best Solution: 0(n) Two Pointer Apporach without using space
public ArrayList<Integer> intersect1(final List<Integer> A, final List<Integer> B) {
ArrayList<Intege... | src/Array/IntersectionSortedArray.java | 0.878549 | 0.482856 | IntersectionSortedArray.java | starcoder |
package edu.duke.cs.jflap.automata.graph;
import edu.duke.cs.jflap.automata.*;
import java.util.*;
/**
* The disjoint sets detector can be used to determine the disjoint sets of
* states in a given automaton. Two sets of states are determined to be disjoint
* if there are no transitions from one set to the other. ... | jflaplib-core/src/main/java/edu/duke/cs/jflap/automata/graph/DisjointSetsDetector.java | 0.847653 | 0.602968 | DisjointSetsDetector.java | starcoder |
package tailspin.samples;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import j... | test/tailspin/samples/TaggedIdentifier.java | 0.94002 | 0.530297 | TaggedIdentifier.java | starcoder |
package org.elixir_lang.parser_definition;
/**
* Created by luke.imhoff on 11/22/14.
*/
public class ListParsingTestCase extends ParsingTestCase {
public void testEmptyParentheses() {
assertParsedAndQuotedCorrectly();
}
public void testMatchedExpression() {
assertParsedAndQuotedCorrectly... | tests/org/elixir_lang/parser_definition/ListParsingTestCase.java | 0.804713 | 0.518851 | ListParsingTestCase.java | starcoder |
import java.util.*;
class TreeNode {
public int id;
public TreeNode left, right, parent;
public TreeNode(int id) {
this.id = id;
}
}
public class IdenticalBSTFromArraySequence {
//If relative order of left sub tree and relative order of right subtree is remain intact then ... | src/IdenticalBSTFromArraySequence.java | 0.563498 | 0.450359 | IdenticalBSTFromArraySequence.java | starcoder |
package plotbot;
/**
* Class representing a plottable line.
* @author bp
*
*/
public class Line implements Plottable {
public double x1;
public double x2;
public double y1;
public double y2;
public double lineCoarse=1; //how fine is the inclined/horizontal line depends on this value
PlotbotControl roboContro... | src/plotbot/Line.java | 0.840324 | 0.47171 | Line.java | starcoder |
package com.edinarobotics.zephyr.parts;
import edu.wpi.first.wpilibj.Jaguar;
import edu.wpi.first.wpilibj.Relay;
/**
*Wraps the conveyor belt, collector lifter and spinner into a class.
*/
public class CollectorComponents {
private Jaguar collectorLift;
private Relay collectorSpin;
private Relay conveyo... | src/com/edinarobotics/zephyr/parts/CollectorComponents.java | 0.826397 | 0.439928 | CollectorComponents.java | starcoder |
package com.radirius.mercury.math.geometry;
import com.radirius.mercury.math.MathUtil;
/**
* A shape with any amount of sides.
*
* @author wessles
* @author Jeviny
*/
public class Polygon extends Shape {
private float radius;
/**
* Creates a new Polygon taking in the center position on the x/y... | Project/src/com/radirius/mercury/math/geometry/Polygon.java | 0.930086 | 0.534309 | Polygon.java | starcoder |
package net.metricspace.crypto.math.ec.group;
import net.metricspace.crypto.math.ec.curve.E521Curve;
import net.metricspace.crypto.math.ec.ladder.MontgomeryLadder;
import net.metricspace.crypto.math.ec.point.EdwardsPoint;
import net.metricspace.crypto.math.field.ModE521M1;
/**
* The E-521 elliptic curve. This curve... | src/main/java/net/metricspace/crypto/math/ec/group/E521.java | 0.919439 | 0.49109 | E521.java | starcoder |
package org.opensourcephysics.numerics.specialfunctions;
import java.util.ArrayList;
import org.opensourcephysics.numerics.Polynomial;
/**
* Chebyshev defines Chebyshev polynomials Tn(x) and Un(x) using
* the well known recurrence relationships. The information needed for this class
* was gained from Alan Je... | workspace_compadre/osp/src/org/opensourcephysics/numerics/specialfunctions/Chebyshev.java | 0.905974 | 0.61173 | Chebyshev.java | starcoder |
package com.company;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
public class Main {
public static void main(String[] args) {
int sum = 8;
ArrayList<Integer> sortedList1 = new ArrayList<>(Arrays.asList(1,2,3,9));
ArrayList<Integer> unsortedList1 = new Ar... | src/com/company/Main.java | 0.648021 | 0.463444 | Main.java | starcoder |
package com.twu.biblioteca;
import org.junit.Assert;
import org.junit.Test;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.util.Scanner;
public class BooksUserInteractionTest {
@Test
public void printBooksInStockTitlesWithAuthorAndYear() throws IOE... | test/com/twu/biblioteca/BooksUserInteractionTest.java | 0.651909 | 0.441733 | BooksUserInteractionTest.java | starcoder |
* Input port windowing interfaces and classes. A window is a well-defined set of tuples that have
* arrived at the input port. The definition of the contents of a window is defined by an
* <em>eviction policy</em>. A window is described by {@link
* com.ibm.streams.operator.window.StreamWindow}, see its documentatio... | src/java/spl/com.ibm.streams.operator.api/src/main/java/com/ibm/streams/operator/window/package-info.java | 0.909214 | 0.451568 | package-info.java | starcoder |
package de.upb.crypto.math.interfaces.hash;
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
/**
* A ByteAccumulator takes a (large) byte-string x as input and outputs a byte array representing f(x) for some function
* f. The function f depends on the concrete instantiation of this class. It ca... | src/main/java/de/upb/crypto/math/interfaces/hash/ByteAccumulator.java | 0.883833 | 0.610657 | ByteAccumulator.java | starcoder |
package be.umons.model;
import be.umons.model.container.*;
import be.umons.model.mapobject.*;
/**
* A Map holds all available {@link Position}s in the stage, every {@link Position} references a {@link ObjectContainer<MapObject>}
* containing all {@link MapObject} placed on it. Semantically, {@link Wall}s are {@link... | src/main/java/be/umons/model/Map.java | 0.86859 | 0.46041 | Map.java | starcoder |
package io.emeraldpay.etherjar.abi;
import java.math.BigInteger;
import java.util.Collections;
import java.util.Map;
import java.util.Optional;
import java.util.function.Function;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import java.util.stream.Stream;
public... | etherjar-abi/src/main/java/io/emeraldpay/etherjar/abi/IntType.java | 0.917159 | 0.420481 | IntType.java | starcoder |
package com.tin.algorithms.gaclustering;
public class Data {
private String name;
private double[] features;
private int numFeatures;
private int cluster;
private int lastCluster;
public Data(String name, int numFeatures) {
this.name = name;
this.numFeatures = numFeatures;
// construct the feature ar... | src/main/java/com/tin/algorithms/gaclustering/Data.java | 0.584864 | 0.412116 | Data.java | starcoder |
package org.apache.ignite.ml.structures.partition;
import java.io.Serializable;
import java.util.Iterator;
import org.apache.ignite.ml.dataset.PartitionDataBuilder;
import org.apache.ignite.ml.dataset.UpstreamEntry;
import org.apache.ignite.ml.math.functions.IgniteBiFunction;
import org.apache.ignite.ml.math.primitive... | modules/ml/src/main/java/org/apache/ignite/ml/structures/partition/LabeledDatasetPartitionDataBuilderOnHeap.java | 0.92738 | 0.42931 | LabeledDatasetPartitionDataBuilderOnHeap.java | starcoder |
package data_structure;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
public class Q460LFUCache {
//Difficulty: Hard
//TAG: Snap
//TAG: data structure
/**
* 460. LFU Cache
* Design and implement a data structure for Least Frequently Use... | src/data_structure/Q460LFUCache.java | 0.736211 | 0.446917 | Q460LFUCache.java | starcoder |
package us.ihmc.robotics.math.trajectories.trajectorypoints;
import us.ihmc.euclid.referenceFrame.ReferenceFrame;
import us.ihmc.euclid.referenceFrame.interfaces.FrameQuaternionReadOnly;
import us.ihmc.euclid.referenceFrame.interfaces.FrameVector3DReadOnly;
import us.ihmc.euclid.transform.interfaces.Transform;
import ... | ihmc-robotics-toolkit/src/main/java/us/ihmc/robotics/math/trajectories/trajectorypoints/FrameSO3TrajectoryPoint.java | 0.926141 | 0.546194 | FrameSO3TrajectoryPoint.java | starcoder |
package org.postgis;
import org.postgresql.util.PGtokenizer;
import java.sql.SQLException;
public class Point extends Geometry {
/* JDK 1.5 Serialization */
private static final long serialVersionUID = 0x100;
public static final boolean CUTINTS = true;
public int hashCode() {
return super.h... | gpdb/contrib/postgis/java/jdbc/src/org/postgis/Point.java | 0.910898 | 0.539772 | Point.java | starcoder |
package org.apache.jena.rdf.model;
import org.apache.jena.graph.FrontsNode ;
/**
Interface covering RDF resources and literals. Allows probing whether a
node is a literal/[blank, URI]resource, moving nodes from model to model,
and viewing them as different Java types using the .as() polymorphism.
*/
publ... | src/main/java/org/apache/jena/rdf/model/RDFNode.java | 0.86293 | 0.454351 | RDFNode.java | starcoder |
package com.opengamma.sesame.engine;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import org.threeten.bp.ZonedDateTime;
import com.googl... | sesame/sesame-engine/src/main/java/com/opengamma/sesame/engine/DefaultEngine.java | 0.841598 | 0.601301 | DefaultEngine.java | starcoder |
package emufog.fog;
import emufog.graph.Node;
import emufog.graph.Router;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
/**
* This node represents an edge node that needs to be connected to a fog node.
*/
class EdgeNode extends FogNode {
/* list of possible fog nodes in range... | src/main/java/emufog/fog/EdgeNode.java | 0.893408 | 0.47524 | EdgeNode.java | starcoder |
package com.googlecode.charts4j;
import static com.googlecode.charts4j.collect.Preconditions.*;
import java.util.List;
import com.googlecode.charts4j.collect.ImmutableList;
import com.googlecode.charts4j.collect.Lists;
import com.googlecode.charts4j.parameters.ChartType;
/**
* Map chart constructed with the {@link... | src/main/java/com/googlecode/charts4j/MapChart.java | 0.952618 | 0.426083 | MapChart.java | starcoder |
package com._7aske.grain.http.json;
import java.util.*;
public class JsonArray implements List<Object>, JsonString {
private final List<Object> data;
public JsonArray() {
this.data = new ArrayList<>();
}
public JsonArray(Object[] objects) {
this(Arrays.asList(objects));
}
public JsonArray(List<Object> ob... | src/main/java/com/_7aske/grain/http/json/JsonArray.java | 0.906098 | 0.506347 | JsonArray.java | starcoder |
package org.embulk.util.guess;
import java.util.Objects;
/**
* Represents (Embulk's) data type estimated by guess.
*
* <p>It reimplements {@code SchemaGuess.GuessedType} in {@code /embulk/guess/schema_guess.rb}.
*
* @see <a href="https://github.com/embulk/embulk/blob/v0.10.19/embulk-core/src/main/ruby/embulk/gue... | src/main/java/org/embulk/util/guess/GuesstimatedType.java | 0.932722 | 0.602471 | GuesstimatedType.java | starcoder |
package org.javaboy.vhr.model;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import java.util.Objects;
public class Salary {
private Integer id;
private Integer basicSalary;
private Integer bonus;
private Integer lunchSalary;
private Integer trafficSalary;
@O... | vhr/vhrserver/vhr-model/src/main/java/org/javaboy/vhr/model/Salary.java | 0.847732 | 0.440409 | Salary.java | starcoder |
package trashsoftware.numbers;
import java.math.BigDecimal;
/**
* The interface of the mathematical real number.
* <p>
* This interface will only have two implementation. If the number can be express as the ratio of two integers,
* it is a {@code Rational}. Otherwise it is an {@code Irrational}.
*
* @author zbh... | src/main/java/trashsoftware/numbers/Real.java | 0.957507 | 0.586848 | Real.java | starcoder |
package selenium.boot.utils.measure.storage;
import java.math.BigInteger;
import java.util.function.Function;
/**
* Exabyte as commonly found in the wild (1 Exabyte = 1 152 921 504 606 846 976 Byte).
*
* @author <a href="mailto:<EMAIL>"><NAME></a>
* @version %I%, %G%
* @since 2.0
*/
public final class Common... | selenium-boot-project/selenium-boot-utils/src/main/java/selenium/boot/utils/measure/storage/CommonExabyte.java | 0.855595 | 0.410579 | CommonExabyte.java | starcoder |
import java.io.File;
import java.util.ArrayList;
import java.util.Random;
import java.util.Scanner;
public class CardMatch {
public static void main(String[] args) throws Exception {
/**
* Adjust canvas settings.
*/
int canvasWidth = 500;
int canvasHeight = 700;
StdDraw.setCanvasSize(canvasWidth, canvas... | C110/Extras/Card Matching Game/CardMatch.java | 0.626124 | 0.457379 | CardMatch.java | starcoder |
package org.rlapi;
import java.util.List;
import java.util.Map;
/**
* Implementation of QLearning algorithm as described in
* the book Reinforcement Learning: An Introduction from R. S. Sutton and
* <NAME>.
*
* @author <NAME>
*/
public class QLearning {
private final Environment environment;
private ... | src/main/java/org/rlapi/QLearning.java | 0.858363 | 0.477432 | QLearning.java | starcoder |
package edu.uci.imbs;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.apache.log4j.Logger;
import com.jmatio.io.MatFileReader;
import com.jmatio.types.MLArray;
import com.jmatio.types.MLDouble;
/**
* Experime... | src/main/java/edu/uci/imbs/Experiment.java | 0.725746 | 0.421195 | Experiment.java | starcoder |
package eu.esco.semic.pilot.model;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
public abstract class MatchingObject {
private static final String[] scoreClasses = {"one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten"};
private List<Skill> missingSkills... | semic-pilot/src/main/java/eu/esco/semic/pilot/model/MatchingObject.java | 0.825062 | 0.46041 | MatchingObject.java | starcoder |
package algorithms.disjointSets;
/**
* a node for the forest implementation of the disjoint set.
first implemented in project
https://github.com/nking/curvature-scale-space-corners-and-transformations
w/ Copyright (c) 2014 Climb With Your Feet
and using The MIT License (MIT)
then moved to this ... | src/main/java/algorithms/disjointSets/DisjointSet2Node.java | 0.895182 | 0.473109 | DisjointSet2Node.java | starcoder |
package dk.alexandra.fresco.tools.ot.otextension;
import dk.alexandra.fresco.framework.MaliciousException;
import dk.alexandra.fresco.framework.network.Network;
import dk.alexandra.fresco.framework.util.StrictBitVector;
import java.util.List;
/**
* Protocol class for the party acting as the receiver in an OT extens... | tools/ot/src/main/java/dk/alexandra/fresco/tools/ot/otextension/BristolOtReceiver.java | 0.904947 | 0.400603 | BristolOtReceiver.java | starcoder |
package org.opencb.opencga.storage.core;
import org.opencb.biodata.formats.io.FileFormatException;
import org.opencb.datastore.core.ObjectMap;
import java.io.IOException;
import java.net.URI;
/**
* ETL cycle consists of the following execution steps:
* extract: fetch data from different sources to be processed, eg... | opencga-storage/opencga-storage-core/src/main/java/org/opencb/opencga/storage/core/StorageETL.java | 0.875215 | 0.435181 | StorageETL.java | starcoder |
package site.markhenrick.adventofcode.y2021;
import site.markhenrick.adventofcode.common.data.IntVector;
import java.util.Map;
import java.util.function.BinaryOperator;
import java.util.regex.MatchResult;
import java.util.regex.Pattern;
class Day02 {
// This implementation is more about being expressive than fast
... | java/src/main/java/site/markhenrick/adventofcode/y2021/Day02.java | 0.804751 | 0.47171 | Day02.java | starcoder |
package com.github.skjolber.dc.model;
import java.util.Comparator;
public class StopTime {
public static final int MISSING_VALUE = -999;
public static Comparator<StopTime> arrivalTimeComparator = new Comparator<StopTime>() {
@Override
public int compare(StopTime o1, StopTime o2) {
return Integer.com... | src/main/java/com/github/skjolber/dc/model/StopTime.java | 0.875068 | 0.442877 | StopTime.java | starcoder |
package com.googlecode.totallylazy.matchers;
import com.googlecode.totallylazy.functions.Function1;
import org.hamcrest.Description;
import org.hamcrest.Matcher;
import org.hamcrest.TypeSafeMatcher;
import java.util.concurrent.Callable;
import static com.googlecode.totallylazy.functions.Callables.returns;
import sta... | ir/src/com/googlecode/totallylazy/matchers/LazyMatcher.java | 0.682679 | 0.413714 | LazyMatcher.java | starcoder |
package eu.researchalps.search.model.response;
/*
* Copyright (C) by Data Publica, All Rights Reserved.
*/
import java.util.Collection;
import java.util.LinkedHashMap;
public class SearchResultHistograms {
private SearchResultHistogram nuts = new SearchResultHistogram();
private SearchResultHistogram countri... | backend/app/src/main/java/eu/researchalps/search/model/response/SearchResultHistograms.java | 0.837321 | 0.438124 | SearchResultHistograms.java | starcoder |
package eveqt;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Random;
import eveqt.operators.binary.BinaryOperator;
import eveqt.operators.unary.UnaryOperator;
import eveqt.terminals.*;
/**
* A static class where all the evolutionary tree operation can be done
* @author AhmedKhalifa
*/
@Su... | src/eveqt/EvEqT.java | 0.813498 | 0.492005 | EvEqT.java | starcoder |
package com.opengamma.sesame.config;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import javax.inject.Provider;
import com.google.common.collect.Maps;
import com.opengamma.sesame.OutputName;
import com.opengamma.sesame.function.scenarios.ScenarioDefinition;
/**... | sesame/sesame-engine/src/main/java/com/opengamma/sesame/config/ConfigBuilder.java | 0.849784 | 0.40028 | ConfigBuilder.java | starcoder |
package de.torqdev.jegl.filters.matrix;
import de.torqdev.jegl.core.FloatImage;
import de.torqdev.jegl.filters.ImageFilter;
import static java.lang.Math.max;
import static java.lang.Math.min;
/**
* Created by lennart on 26.05.2017.
*/
public abstract class AbstractMatrixFilter implements ImageFilter {
private ... | jegl-core/src/main/java/de/torqdev/jegl/filters/matrix/AbstractMatrixFilter.java | 0.913986 | 0.546012 | AbstractMatrixFilter.java | starcoder |
package io.improbable.keanu.vertices.tensor.number.floating.dbl.nonprobabilistic.operators.multiple;
import io.improbable.keanu.annotation.ExportVertexToPythonBindings;
import io.improbable.keanu.tensor.TensorShape;
import io.improbable.keanu.tensor.dbl.DoubleTensor;
import io.improbable.keanu.vertices.LoadVertexParam... | keanu-project/src/main/java/io/improbable/keanu/vertices/tensor/number/floating/dbl/nonprobabilistic/operators/multiple/ConcatenationVertex.java | 0.873579 | 0.571767 | ConcatenationVertex.java | starcoder |
package SnakesAndLadders;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import org.junit.Before;
import org.junit.Test;
... | tests/SnakesAndLadders/BoardTest.java | 0.826467 | 0.675168 | BoardTest.java | starcoder |
package fifteen;
import java.util.HashMap;
import java.util.Map;
public final class PerfectlySphericalHousesinaVacuum {
static final class Location {
final int x;
final int y;
public Location(final int pos1, final int pos2) {
x = pos1;
y = pos2;
}
... | src/main/java/fifteen/PerfectlySphericalHousesinaVacuum.java | 0.90767 | 0.406803 | PerfectlySphericalHousesinaVacuum.java | starcoder |
package io.github.pureza.warbots.collection;
import java.util.*;
/**
* A graph
*
* This graph is undirected.
*
* @param <V> stands for the data type held by a vertex
* @param <E> stands for the data type held by an edge
*/
public class Graph<V, E> {
/**
* Maps vertices connected by an edge
*
... | src/main/java/io/github/pureza/warbots/collection/Graph.java | 0.927728 | 0.560072 | Graph.java | starcoder |
package nn1.neuralnetwork;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.LinkedList;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Formatter;
import java.util.TreeSet;
import nn1.RTree_3d_ref;
/**
*
*/
public class SelfOrganizingMap_arr_hc_toroid
{
//<e... | src/nn1/neuralnetwork/SelfOrganizingMap_arr_hc_toroid.java | 0.663015 | 0.42483 | SelfOrganizingMap_arr_hc_toroid.java | starcoder |
package no.ion.jake.graph;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* A directed acyclic graph.
*
* @param <T> type of payload
*/
public class Dag<T> {
private final HashSet<Vertex<T>> vertices;
private final HashSet<Vertex<... | src/no/ion/jake/graph/Dag.java | 0.936117 | 0.450299 | Dag.java | starcoder |
package org.teavm.flavour.regex.core;
import java.util.Arrays;
import java.util.Objects;
/**
*
* @author <NAME>
*/
public class MapOfChars<T> implements Cloneable {
int[] toggleIndexes;
int size;
Object[] data;
public MapOfChars() {
toggleIndexes = new int[4];
data = new Object[4];... | regex/src/main/java/org/teavm/flavour/regex/core/MapOfChars.java | 0.770465 | 0.523725 | MapOfChars.java | starcoder |
package io.octoprime.algo.strings;
import java.util.Arrays;
import java.util.HashMap;
/**
* Given two strings s1 and s2, write a function to return true if s2 contains the permutation of s1.
* In other words, one of the first string's permutations is the substring of the second string.
* <p>
* Example 1:
* Input... | src/main/java/io/octoprime/algo/strings/PermutationInSubString.java | 0.842475 | 0.494202 | PermutationInSubString.java | starcoder |
package java.lang;
class Byte {
@STAMP(flows = { @Flow(from = "value", to = "this") })
public Byte(byte value) {
}
@STAMP(flows = { @Flow(from = "string", to = "this") })
public Byte(java.lang.String string) throws java.lang.NumberFormatException {
}
@STAMP(flows = { @Flow(from = "string... | android/models/src/java/lang/Byte.java | 0.853471 | 0.553928 | Byte.java | starcoder |
package gulava;
import static gulava.Goals.UNIT;
import static gulava.Goals.conj;
import static gulava.Goals.same;
import gulava.annotation.MakeLogicValue;
import gulava.annotation.MakePredicates;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.ListIterator;
/**
* A gen... | java/gulava/Cons.java | 0.823044 | 0.402803 | Cons.java | starcoder |
package nl.rutgerkok.bo3tools;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import nl.rutgerkok.bo3tools.util.BlockLocation;
import nl.rutgerkok.bo3tools.util.InvalidBO3Exception;
import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.bukkit.selections.Selection;
public class... | src/main/java/nl/rutgerkok/bo3tools/NextBO3Data.java | 0.893426 | 0.477371 | NextBO3Data.java | starcoder |
package ca.eandb.jmist.framework;
import ca.eandb.jmist.framework.color.Color;
import ca.eandb.jmist.math.AffineMatrix3;
import ca.eandb.jmist.math.Ray3;
/**
* Represents the properties of a ray-scatter event, which may be a ray
* scattered from a material interaction, or emission from a light source.
* @author <N... | jmist-core/src/main/java/ca/eandb/jmist/framework/ScatteredRay.java | 0.943621 | 0.657497 | ScatteredRay.java | starcoder |
package com.github.yellowstonegames.smooth;
import com.badlogic.gdx.math.Interpolation;
import com.github.tommyettinger.ds.support.BitConversion;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
/**
* Allows specifying a smoothly-changing float value using any float for the start and the end, with... | squidsmooth/src/main/java/com/github/yellowstonegames/smooth/FloatGlider.java | 0.920442 | 0.509642 | FloatGlider.java | starcoder |
package se.cygni.snake.game;
public class GameFeatures {
// World width
public int width = 25;
// World height
public int height = 25;
// Maximum noof players in this game
public int maxNoofPlayers = 5;
// The starting length of a snake
public int startSnakeLength = 1;
// The t... | app/src/main/java/se/cygni/snake/game/GameFeatures.java | 0.821868 | 0.530419 | GameFeatures.java | starcoder |
package com.ibm.pross.common.util.crypto.ecc;
import java.math.BigInteger;
import com.ibm.pross.common.util.Exponentiation;
/**
* Implements methods for hashing to an arbitrary point on an elliptic curve
*
* This class uses methods for computing square roots requires: (p % 4) == 3.
*
* This uses the "Simplifi... | pross-common/src/main/java/com/ibm/pross/common/util/crypto/ecc/SwuPointHasher.java | 0.944702 | 0.519278 | SwuPointHasher.java | starcoder |
package gnova.geometry.model.impl.jts;
import gnova.core.annotation.NotNull;
import gnova.geometry.model.CoordinateSequenceFactory;
import gnova.geometry.model.*;
import gnova.geometry.model.GeometryFactory;
import org.locationtech.jts.geom.PrecisionModel;
import java.util.Arrays;
/**
* Created by Birderyu on 2017/6... | library/geometry/src/main/java/gnova/geometry/model/impl/jts/GeometryFactoryAdaptor.java | 0.940113 | 0.500549 | GeometryFactoryAdaptor.java | starcoder |
package com.acrylic.universal.geometry.circular;
import com.acrylic.universal.geometry.IndexedRotatableGeometry;
import com.acrylic.universal.math.MathUtils;
import com.acrylic.universal.math.Orientation3D;
import org.bukkit.Location;
import org.bukkit.util.Vector;
import org.jetbrains.annotations.NotNull;
import org.... | Universal/src/main/java/com/acrylic/universal/geometry/circular/Circular.java | 0.933907 | 0.624165 | Circular.java | starcoder |
package org.opensim.modeling;
/**
* An OpenSim Joint is an OpenSim::ModelComponent which connects two PhysicalFrames<br>
* together and specifies their relative permissible motion as described in<br>
* internal coordinates. The base Joint specifies two frames (e.g. one per body),<br>
* which the joint spans. The r... | Gui/opensim/modeling/src/org/opensim/modeling/Joint.java | 0.919755 | 0.697937 | Joint.java | starcoder |
package ad.dummies.p03problems.c08knapsack;
import java.util.*;
public class E03KnapsackBnB {
public static class KnapsackObject {
public final double weight;
public final double value;
public KnapsackObject(double weight, double value) {
this.weight = weight;
this.... | src/main/java/ad/dummies/p03problems/c08knapsack/E03KnapsackBnB.java | 0.727589 | 0.449332 | E03KnapsackBnB.java | starcoder |
package org.pathvisio.biopax3.layout;
/**
* This class offers a hook for layout algorithms to operate on.
*/
public interface MutableGraphLayout extends GraphLayout
{
/**
* Tells us whether or not the node at index <code>nodeIndex</code>
* can be moved by <code>setNodePosition()</code>.
*
* @param no... | src/org/pathvisio/biopax3/layout/MutableGraphLayout.java | 0.862786 | 0.430925 | MutableGraphLayout.java | starcoder |
package org.sbml.libsbml;
/**
* Log of errors and other events encountered while processing an XML
* file or data stream.
* <p>
* <em style='color: #555'>
This class of objects is defined by libSBML only and has no direct
equivalent in terms of SBML components. This class is not prescribed by
the SBML specificat... | external/sbml/bindings/java/java-files/org/sbml/libsbml/XMLErrorLog.java | 0.892451 | 0.417093 | XMLErrorLog.java | starcoder |
package LBJ2.IR;
import LBJ2.Pass;
/**
* LBJ supports every Java operator. This class stores information about
* those operators, such as their symbols and precedences, as well as
* information about LBJ's new operators. The static constant fields defined
* in this class serve as indeces into its static ar... | src/main/java/LBJ2/IR/Operator.java | 0.666171 | 0.417687 | Operator.java | starcoder |
package at.datasciencelabs.pattern;
import net.entropysoft.transmorph.utils.NumberComparator;
import java.util.Arrays;
import java.util.function.Supplier;
/**
* Supports evaluating a set of operators
*/
public enum Operator {
EQUALS("=", Object::equals),
NOT_EQUALS("!=", new Evaluator() {
@Overrid... | src/main/java/at/datasciencelabs/pattern/Operator.java | 0.930237 | 0.484075 | Operator.java | starcoder |
package com.datastax.oss.driver.api.querybuilder.select;
import com.datastax.oss.driver.api.core.CqlIdentifier;
import com.datastax.oss.driver.api.core.context.DriverContext;
import com.datastax.oss.driver.api.core.type.DataType;
import com.datastax.oss.driver.api.core.type.DataTypes;
import com.datastax.oss.driver.ap... | query-builder/src/main/java/com/datastax/oss/driver/api/querybuilder/select/OngoingSelection.java | 0.874453 | 0.46035 | OngoingSelection.java | starcoder |
package prefuse.data;
import java.util.Date;
/**
* Tuples are objects representing a row of a data table, providing a simplified
* interface to table data. They maintain a pointer to a corresponding row in a
* table. When rows are deleted, any live Tuples for that row become
* invalidated, and any furth... | src/prefuse/data/Tuple.java | 0.897173 | 0.59302 | Tuple.java | starcoder |
package com.gs.tablasco.verify;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import java.io.Serializable;
import java.text.NumberFormat;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.function.Predicate;
/**
* Bean which holds result information for each ... | tablasco-junit/src/main/java/com/gs/tablasco/verify/ResultCell.java | 0.915738 | 0.482551 | ResultCell.java | starcoder |
package dev.maxkatz.queenssolver;
import java.util.ArrayList;
import lombok.Getter; // Use lombok to support @Getter annotations for testing purposes
/**
* This class represents an n-by-n chessboard, and provides utilities
* for placing or removing queens and for analyzing the current
* state of the board.
*
... | src/main/java/dev/maxkatz/queenssolver/Board.java | 0.870927 | 0.479016 | Board.java | starcoder |
package com.joybean.leetcode;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Deque;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* <a href="https://leetcode.com/problems/minimum-height-tr... | src/main/java/com/joybean/leetcode/MinimumHeightTrees.java | 0.926636 | 0.42662 | MinimumHeightTrees.java | starcoder |
package hu.bme.mit.theta.core.type.bvtype;
import hu.bme.mit.theta.core.type.Expr;
import hu.bme.mit.theta.core.type.inttype.IntLitExpr;
import java.util.List;
public final class BvExprs {
private BvExprs() {
}
public static BvType BvType(final int size, final Boolean signedness) {
return BvType.of(size, sig... | subprojects/common/core/src/main/java/hu/bme/mit/theta/core/type/bvtype/BvExprs.java | 0.670716 | 0.593315 | BvExprs.java | starcoder |
package Utility;
public final class Vector2 {
private double x;
private double y;
public Vector2() {
this(0.0D, 0.0D);
}
public Vector2(double x, double y) {
set(x, y);
}
public Vector2(Vector2 other) {
this(other.getX(), other.getY());
}
... | src/Utility/Vector2.java | 0.820397 | 0.600511 | Vector2.java | starcoder |
Copyright 2015, Google Inc.
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 writi... | software/android/orp-android/app/src/main/java/orp/orp/crypto/EdwardsCurve.java | 0.916077 | 0.403097 | EdwardsCurve.java | starcoder |
public class AESCipherOld {
/**
* This S Box contains all of the values needed for our substitution portion
* of the cipher
*/
private static final String[] sbox = {
"63", "7C", "77", "7B", "F2", "6B", "6F", "C5", "30", "01", "67", "2B",
"FE", "D7", "AB", "76", "CA", "82", "C9", "7D", "FA", "5... | IntellijTests/src/main/AESCipherOld.java | 0.753557 | 0.477676 | AESCipherOld.java | starcoder |
package org.codehaus.prometheus.waitpoint;
import static org.codehaus.prometheus.concurrenttesting.ConcurrentTestUtil.giveOthersAChance;
import static org.codehaus.prometheus.concurrenttesting.ConcurrentTestUtil.joinAll;
/**
* Unittests the {@link org.codehaus.prometheus.waitpoint.CloseableWaitpoint#pass()} method.
... | src-sandbox/sandboxtest/org/codehaus/prometheus/waitpoint/CloseableWaitpoint_PassTest.java | 0.764716 | 0.433622 | CloseableWaitpoint_PassTest.java | starcoder |
package Comparatori_Generici;
/**
* Example with parametric choice of sort direction
*/
public class MySortAnonymousClasses {
/**
* Labels to specify order direction
*/
public enum SortDirection {
INCREASING,
DECREASING
}
interface IntComparator {
boolean compare(i... | src/main/java/Comparatori_Generici/MySortAnonymousClasses.java | 0.921468 | 0.435541 | MySortAnonymousClasses.java | starcoder |
package unimelb.edu.au.search;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.lucene.index.Term;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.sear... | DQBioinformatics/src/unimelb/edu/au/search/QueryQualityFeatures.java | 0.855821 | 0.519156 | QueryQualityFeatures.java | starcoder |
package Assignment3;
import java.util.Scanner;
public class ClosestPoints {
public static void main(String[] args) {
final int big = 100;
Scanner input = new Scanner(System.in);
System.out.print("Enter the number points: ");
int num = input.nextInt();
double[][] points = n... | src/Assignment3/ClosestPoints.java | 0.583915 | 0.423339 | ClosestPoints.java | starcoder |
public class DP {
/*
DP is an algorithmic paradigm that solves a given complex problem by
breaking it into subproblems and storing the results of subproblems to
avoid computing the same results again.
1. overlapping subproblems
2. optimal substructure
Solution: use memory: memorizatio... | DP.java | 0.593374 | 0.469885 | DP.java | starcoder |
package dap4.core.data;
import dap4.core.dmr.DapNode;
import dap4.core.util.DapSort;
/**
* The Data*.java classes
* provide a new representation for
* accessing data sources.
* They are intended to be analogous to the ucar.ma2.Array
* classes in CDM. The big differences are:
* <ol>
* <li> They closely parallel... | dap4/d4core/src/main/java/dap4/core/data/Data.java | 0.745491 | 0.432183 | Data.java | starcoder |
package us.ihmc.commonWalkingControlModules.highLevelHumanoidControl.factories;
import java.util.ArrayList;
import us.ihmc.robotics.dataStructures.registry.YoVariableRegistry;
import us.ihmc.robotics.dataStructures.variable.DoubleYoVariable;
import us.ihmc.robotics.geometry.FramePoint;
import us.ihmc.robotics.geometr... | CommonWalkingControlModules/src/us/ihmc/commonWalkingControlModules/highLevelHumanoidControl/factories/DiagnosticsWhenHangingHelper.java | 0.844216 | 0.59972 | DiagnosticsWhenHangingHelper.java | starcoder |
package org.provotum.security.elgamal;
import org.bouncycastle.jce.interfaces.ElGamalPublicKey;
import org.provotum.security.arithmetic.ModInteger;
import java.math.BigInteger;
/**
* An ElGamal public key.
*/
public class PublicKey {
private final ModInteger p;
private final ModInteger q;
private fina... | src/main/java/org/provotum/security/elgamal/PublicKey.java | 0.938456 | 0.451145 | PublicKey.java | starcoder |
package org.opencb.biodata.tools.variant.stats;
import org.opencb.biodata.models.variant.AllelesCode;
import org.opencb.biodata.models.variant.Genotype;
import org.opencb.biodata.models.pedigree.Condition;
import org.opencb.biodata.models.pedigree.Individual;
import org.opencb.biodata.models.pedigree.Pedigree;
import ... | biodata-tools/src/main/java/org/opencb/biodata/tools/variant/stats/VariantStatsPedigree.java | 0.577972 | 0.418281 | VariantStatsPedigree.java | starcoder |
package walkingkooka.tree.search;
import walkingkooka.visit.Visiting;
import walkingkooka.visit.Visitor;
import java.util.Objects;
/**
* A {@link Visitor} for a graph of {@link SearchNode}.
*/
public abstract class SearchNodeVisitor extends Visitor<SearchNode> {
protected SearchNodeVisitor() {
super()... | src/main/java/walkingkooka/tree/search/SearchNodeVisitor.java | 0.850375 | 0.478651 | SearchNodeVisitor.java | starcoder |
package de.uniwue.VNFP.algo;
import de.uniwue.VNFP.model.Link;
import de.uniwue.VNFP.model.NetworkGraph;
import de.uniwue.VNFP.model.Node;
import de.uniwue.VNFP.model.TrafficRequest;
import de.uniwue.VNFP.model.solution.NodeAssignment;
import de.uniwue.VNFP.model.solution.TrafficAssignment;
import java.util.*;
/**
... | java/VNFP/src/de/uniwue/VNFP/algo/FlowUtils.java | 0.888402 | 0.556882 | FlowUtils.java | starcoder |
public class Date implements Comparable<Date> {
private static final int[] DAYS = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
private final int month; // month (between 1 and 12)
private final int day; // day (between 1, and DAYS[month]
private final int year; // year
// Is y ... | algs4/Date.java | 0.925575 | 0.513607 | Date.java | starcoder |
package com.opengamma.strata.pricer.credit;
import org.joda.convert.FromString;
import org.joda.convert.ToString;
import com.opengamma.strata.collect.named.EnumNames;
import com.opengamma.strata.collect.named.NamedEnum;
/**
* The formula for accrual on default.
* <p>
* This specifies which formula is used in {@co... | modules/pricer/src/main/java/com/opengamma/strata/pricer/credit/AccrualOnDefaultFormula.java | 0.863276 | 0.420778 | AccrualOnDefaultFormula.java | starcoder |
import javax.swing.ImageIcon;
public class FireBall extends Sprite {
private final String fireball = "/Fireball.png";
ImageIcon ii = new ImageIcon(this.getClass().getResource(fireball));
private int multiplier; //Either multiplies the x and y values by positive or negative
public FireBall() {
... | src/FireBall.java | 0.719679 | 0.402539 | FireBall.java | starcoder |
package com.google.i18n.phonenumbers.metadata.table;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.collect.ImmutableList.toImmutableList;
import static com.google.common.collect.ImmutableSet.toImmutable... | metadata/src/main/java/com/google/i18n/phonenumbers/metadata/table/CsvTable.java | 0.902867 | 0.456168 | CsvTable.java | starcoder |
package Poker;
import java.util.ArrayList;
import Core.Card;
public class PokerProps {
/**
* @description Return the index corresponding to the card type. Used for calculating the hand rank
*/
public static int getTypeIndex(String type) {
switch(type) {
case "ace": return 0;
case "two": return 1;
... | src/Poker/PokerProps.java | 0.681197 | 0.472744 | PokerProps.java | starcoder |
package dk.mmj.eevhe.crypto.zeroknowledge;
import dk.mmj.eevhe.crypto.SecurityUtils;
import dk.mmj.eevhe.entities.*;
import java.math.BigInteger;
public class VoteProofUtils {
/**
* Method for generating zero-knowledge proof for vote that is either 0 or 1
*
* @param cipherText ciphertext from enc... | src/main/java/dk/mmj/eevhe/crypto/zeroknowledge/VoteProofUtils.java | 0.872944 | 0.464902 | VoteProofUtils.java | starcoder |
package com.cdl.kata.services;
import static org.junit.Assert.*;
import java.util.HashMap;
import java.util.Map;
import org.junit.Test;
import com.cdl.kata.model.Basket;
import com.cdl.kata.model.Offers;
import com.cdl.kata.model.ProductAndOfferInventory;
import com.cdl.kata.model.ProductCatagory;
import com.cdl.ka... | test/com/cdl/kata/services/ShopingBasketServiceTest.java | 0.789274 | 0.434881 | ShopingBasketServiceTest.java | starcoder |
package fr.wonder.commons.math.vectors;
import fr.wonder.commons.math.Mathf;
public class Vec2 {
/** Float component of the vector */
public float x, y;
/**
* Default constructor, xy = xy
* @param x the x component of the vector
* @param y the y component of the vector
*/
public Vec2(f... | src/fr/wonder/commons/math/vectors/Vec2.java | 0.893455 | 0.581838 | Vec2.java | starcoder |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.