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 org.avmframework.examples.requirementassignment;
import org.avmframework.Vector;
import org.avmframework.objective.NumericObjectiveValue;
import org.avmframework.objective.ObjectiveFunction;
import org.avmframework.objective.ObjectiveValue;
import java.text.DecimalFormat;
import java.util.ArrayList;
import ja... | src/main/java/org/avmframework/examples/requirementassignment/RequirementObjectiveFunction.java | 0.842992 | 0.498596 | RequirementObjectiveFunction.java | starcoder |
package org.eclipse.cdt.core.model;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IProgressMonitor;
/**
* A buffer contains the text contents of a resource. It is not language-specific.
* The contents may be in the process of being edited, differing from the actual contents of the
*... | export/model/org/eclipse/cdt/core/model/IBuffer.java | 0.917066 | 0.425009 | IBuffer.java | starcoder |
package com.thedeveloperworldisyours.myvocabulary.data;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import com.thedeveloperworldisyours.myvocabulary.data.source.WordsDataSource;
import com.thedeveloperworldisyours.myvocabulary.data.source.local.WordsLocalData... | app/src/androidTest/java/com/thedeveloperworldisyours/myvocabulary/data/WordLocalDataSourceTest.java | 0.715523 | 0.408395 | WordLocalDataSourceTest.java | starcoder |
package com.rad2.common.collection;
import com.rad2.common.utils.PrintUtils;
import java.util.*;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.stream.Collectors;
public class NAryTreeNode<T> {
private NAryTreeNode parent;
private Map<String, NAryTreeNode<T>> childr... | rad2-common/src/main/java/com/rad2/common/collection/NAryTreeNode.java | 0.888572 | 0.433142 | NAryTreeNode.java | starcoder |
package org.mariuszgromada.math.mxparser.mathcollection;
/**
* SpecialValue - generic class for storing special values of various functions (e.g.: inverse trigonometric).
*
* @author <b><NAME></b><br>
* <a href="mailto:<EMAIL>"><EMAIL></a><br>
* <a href="http://mathspace.pl... | CURRENT/java/src/org/mariuszgromada/math/mxparser/mathcollection/SpecialValue.java | 0.799599 | 0.498901 | SpecialValue.java | starcoder |
package us.ihmc.quadrupedRobotics.providers;
import java.util.concurrent.atomic.AtomicReference;
import controller_msgs.msg.dds.ComPositionPacket;
import controller_msgs.msg.dds.ComVelocityPacket;
import us.ihmc.commons.MathTools;
import us.ihmc.communication.net.PacketConsumer;
import us.ihmc.communication.streaming... | ihmc-quadruped-robotics/src/main/java/us/ihmc/quadrupedRobotics/providers/QuadrupedPostureInputProvider.java | 0.905589 | 0.421909 | QuadrupedPostureInputProvider.java | starcoder |
package game_engine.properties;
import java.io.Serializable;
import java.util.Arrays;
import java.util.List;
/**
* Position is a property that represents the position of a unit on the map.
* Top left is 0,0 and x,y increases going right and down respectively.
*
*
*/
public class Position extends Property imple... | src/game_engine/properties/Position.java | 0.908107 | 0.464962 | Position.java | starcoder |
package ca.eandb.jmist.framework.lens;
import ca.eandb.jmist.framework.ScatteredRay;
import ca.eandb.jmist.framework.color.Color;
import ca.eandb.jmist.framework.path.EyeNode;
import ca.eandb.jmist.framework.path.EyeTerminalNode;
import ca.eandb.jmist.framework.path.PathInfo;
import ca.eandb.jmist.math.HPoint3;
import... | jmist-core/src/main/java/ca/eandb/jmist/framework/lens/PanoramicLens.java | 0.883851 | 0.513851 | PanoramicLens.java | starcoder |
package com.siimkinks.sqlitemagic.internal;
import java.util.Map;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
/**
* Base implementation of Android ArrayMap that doesn't include any standard Java
* container API interoperability. These features are generally heavier-weight ways
* to i... | runtime/src/main/java/com/siimkinks/sqlitemagic/internal/SimpleArrayMap.java | 0.905092 | 0.443841 | SimpleArrayMap.java | starcoder |
package com.brcolow.candlefx;
import java.util.Objects;
/**
* Container to ease passing around a tuple of two objects. This object provides a sensible
* implementation of equals(), returning true if equals() is true on each of the contained
* objects.
*/
public class SymmetricPair<F, S> {
private final F firs... | api/src/main/java/com/brcolow/candlefx/SymmetricPair.java | 0.945651 | 0.515803 | SymmetricPair.java | starcoder |
package io.spine.server.storage.datastore;
import com.google.protobuf.Descriptors.Descriptor;
import com.google.protobuf.Message;
import io.spine.annotation.Internal;
import io.spine.type.TypeName;
import io.spine.type.TypeUrl;
import io.spine.value.StringTypeValue;
import static com.google.common.base.Preconditions.... | datastore/src/main/java/io/spine/server/storage/datastore/Kind.java | 0.873161 | 0.470311 | Kind.java | starcoder |
package org.gbif.pipelines.parsers.parsers.temporal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.Month;
import java.time.MonthDay;
import java.time.OffsetDateTime;
import java.time.OffsetTime;
import java.time.Year;
import java.time.YearMonth;
import java.ti... | sdks/parsers/src/main/java/org/gbif/pipelines/parsers/parsers/temporal/TemporalParser.java | 0.811153 | 0.432902 | TemporalParser.java | starcoder |
package ru.job4j.generic.simplearray;
import java.util.ConcurrentModificationException;
import java.util.Iterator;
import java.util.NoSuchElementException;
/**
* В этом задании необходимо сделать универсальную обертку над массивом.
* Итератор должен реализовывать fail-fast поведение
*
* @param <T>
*/
public clas... | junior_001/src/main/java/ru/job4j/generic/simplearray/SimpleArray.java | 0.527317 | 0.436982 | SimpleArray.java | starcoder |
package org.coderoller.jnisample;
import android.support.test.runner.AndroidJUnit4;
import org.coderoller.jnisample.testers.ObjectTester;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert... | app/JniSample/app/src/androidTest/java/org/coderoller/jnisample/ObjectUnitTest.java | 0.821008 | 0.487734 | ObjectUnitTest.java | starcoder |
import java.util.Scanner;
import java.util.Arrays;
/**
* Bubble sort, sometimes referred to as sinking sort, is a simple sorting algorithm that repeatedly
* steps through the list, compares adjacent pairs and swaps them if they are in the wrong order.
* The pass through the list is repeated until the list is sorted... | java/sort/BubbleSort.java | 0.785309 | 0.494507 | BubbleSort.java | starcoder |
package org.turner.opie.utils;
import java.util.regex.Pattern;
/**
* Encodes and decodes byte arrays as hex-encoded strings.
*
* @author turner
* @since 1.0
*/
public final class HexEncoder {
/** All possible hexits, ordered. */
private static final char[] HEX_CHARS = {'0', '1', '2', '3',
... | src/main/java/org/turner/opie/utils/HexEncoder.java | 0.918498 | 0.407481 | HexEncoder.java | starcoder |
package com.korbi.simplesudoku.logic;
import com.korbi.simplesudoku.sudokuviews.SudokuCellView;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
/**
* Created by korbi on 7/26/17.
* This class handles the generation and validation of the sudokus
*/
public class SudokuLogic
{
priva... | app/src/main/java/com/korbi/simplesudoku/logic/SudokuLogic.java | 0.565299 | 0.511839 | SudokuLogic.java | starcoder |
package com.josedab.interviewbit.backtracking;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
/**
* The gray code is a binary numeral system where two successive values differ in only one bit.
Given a non-negative integer n representing the total number of bits in the code, print t... | src/main/java/com/josedab/interviewbit/backtracking/GrayCode.java | 0.886789 | 0.524577 | GrayCode.java | starcoder |
public class GradientRectangle extends Rectangle {
private int color2;
/**
* Constructs a GradientRectangle.
*
* @param color1 the hexadecimal color of the top of the rectangle
* @param color2 the hexadecimal color of the bottom of the rectangle
* @param x the x coordinate of the upper left corner
... | src/GradientRectangle.java | 0.936125 | 0.618204 | GradientRectangle.java | starcoder |
package com.blazebit.expression;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Function;
/**
* A simple implementation of a context for the {@link ExpressionInterpreter}.
*
* @param <T> The object provider context type
* @author <NAME>
* @since 1.0.0
*/
public class ExpressionInterpr... | core/api/src/main/java/com/blazebit/expression/ExpressionInterpreterContext.java | 0.963746 | 0.435181 | ExpressionInterpreterContext.java | starcoder |
package deepboof;
import java.util.List;
/**
* <p>High level interface for functions in an Artificial Neural Network. This interface only defines the
* the operations in the forwards pass. When learning a network the gradient is typically needed and
* those additional operations can be found in {@link DFunction}... | modules/main/src/main/java/deepboof/Function.java | 0.93402 | 0.639061 | Function.java | starcoder |
package roadgraph;
import geography.GeographicPoint;
import java.util.Objects;
/**
* @author NickVeremeichyk
* @since 2016-01-11.
*/
public abstract class MapPoint implements Comparable {
private MapNode mapNode;
private MapNode previousNode;
private Double distanceSum;
private Double distance;
... | src/roadgraph/MapPoint.java | 0.850577 | 0.470128 | MapPoint.java | starcoder |
package unalcol.search.selection;
import unalcol.random.integer.IntUniform;
import unalcol.types.collection.vector.Vector;
/**
* <p>Title: Tournament</p>
* <p>Description: A tournament selection strategy. In this strategy each individual that
* is chosen is selected from a group of individuals. The group of indivi... | src/main/java/unalcol/search/selection/Tournament.java | 0.879574 | 0.622345 | Tournament.java | starcoder |
package simulation;
import cell.Cell;
import grid.GridOfCells;
import javafx.animation.Animation;
import javafx.animation.KeyFrame;
import javafx.animation.Timeline;
/**
* The simulation super class, hold the skeleton of what all simulations should at least contain and
* implement.
*/
public abstract class Simula... | src/simulation/Simulation.java | 0.850949 | 0.448547 | Simulation.java | starcoder |
package q154869;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.NoSuchElementException;
import static q154869.Medicine.Antibiotic;
import static q154869.Medicine.Aspirin;
import static q154869.Medicine.Insulin;
import static q154869.Medicine.None;
import static q154869.Me... | src/main/java/q154869/Quarantine.java | 0.724383 | 0.419351 | Quarantine.java | starcoder |
package co.edu.uniandes.csw.turismo.ejb;
import co.edu.uniandes.csw.turismo.entities.GuiaEntity;
import co.edu.uniandes.csw.turismo.entities.PlanAgendadoEntity;
import co.edu.uniandes.csw.turismo.entities.PlanEntity;
import co.edu.uniandes.csw.turismo.exceptions.BusinessLogicException;
import co.edu.uniandes.csw.turis... | turismo-back/src/main/java/co/edu/uniandes/csw/turismo/ejb/PlanAgendadoLogic.java | 0.552057 | 0.44897 | PlanAgendadoLogic.java | starcoder |
package com.github.scaronthesky.eternalwinterwars.model.units;
import com.github.scaronthesky.eternalwinterwars.model.armamentBehaviours.ArmamentBehaviour;
import com.github.scaronthesky.eternalwinterwars.model.players.PlayerInterface;
import com.github.scaronthesky.eternalwinterwars.model.units.actionpointbehaviours.... | model/units/Unit.java | 0.816333 | 0.41739 | Unit.java | starcoder |
package io.vproxy.base.util;
import io.vproxy.base.util.bytearray.*;
import io.vproxy.base.util.nio.ByteArrayChannel;
import java.io.ByteArrayOutputStream;
import java.nio.ByteBuffer;
@SuppressWarnings("UnusedReturnValue")
public interface ByteArray extends ToByteArray {
static ByteArray allocate(int len) {
... | base/src/main/java/io/vproxy/base/util/ByteArray.java | 0.76454 | 0.479443 | ByteArray.java | starcoder |
package net.lecousin.framework.collections;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import net.lecousin.framework.util.ObjectUtil;
/**
* Tree structure where each node contains an element of type T, and sub-nodes as a Tree.
* @param <T> type of elements.
*/
public class Tree<... | net.lecousin.core/src/main/java/net/lecousin/framework/collections/Tree.java | 0.911125 | 0.40642 | Tree.java | starcoder |
package org.at4j.support.lang;
import java.io.IOException;
import java.io.InputStream;
import java.io.Serializable;
import java.math.BigInteger;
import org.entityfs.RandomAccess;
import org.entityfs.exception.UnexpectedEofException;
import org.entityfs.support.exception.WrappedIOException;
/**
* This object represe... | src/AT4J_support/src/org/at4j/support/lang/UnsignedLong.java | 0.925905 | 0.461077 | UnsignedLong.java | starcoder |
package imop.lib.util;
import imop.lib.util.CollectorVisitor.NeighbourSetGetter;
import java.util.*;
public class TraversalOrderObtainer {
public static long orderGenerationTime = 0;
public static void resetStaticFields() {
TraversalOrderObtainer.orderGenerationTime = 0;
}
/**
* Starting with {@code entryN... | src/imop/lib/util/TraversalOrderObtainer.java | 0.883563 | 0.544438 | TraversalOrderObtainer.java | starcoder |
package org.deidentifier.arx.framework.data;
/**
* Abstract matrix representation.
*
* @author <NAME>
*
*/
public abstract class Matrix {
/** The number of rows. */
protected final int rows;
/** The number of columns. */
protected final int columns;
public Matrix(final int rows, final int columns) {
t... | src/main/org/deidentifier/arx/framework/data/Matrix.java | 0.929672 | 0.506103 | Matrix.java | starcoder |
package org.craft.spongeimpl.math;
import org.craft.maths.*;
import org.spongepowered.api.math.*;
public class Vec3i implements Vector3i
{
/**
*
*/
private static final long serialVersionUID = 4005959954267878505L;
private int x;
private int y;
private int ... | src/main/java/org/craft/spongeimpl/math/Vec3i.java | 0.926781 | 0.533397 | Vec3i.java | starcoder |
package io.amient.affinity.core.util;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.ByteBuffer;
import java.util.Arrays;
import java.util.UUID;
public class ByteUtils {
/**
* Converts ByteBuffer to an array - if the buffer is backed by the array but do... | api/src/main/java/io/amient/affinity/core/util/ByteUtils.java | 0.856197 | 0.58602 | ByteUtils.java | starcoder |
package ca.pringle.maze.logic;
import java.util.Arrays;
import java.util.Objects;
import static ca.pringle.maze.util.Checks.check;
public final class SpecializedGraph {
private final SpecializedList[] nodes;
private SpecializedGraph(final SpecializedList[] nodes) {
this.nodes = check(nodes).isNotN... | src/main/java/ca/pringle/maze/logic/SpecializedGraph.java | 0.889595 | 0.539893 | SpecializedGraph.java | starcoder |
package cls;
import java.io.File;
import java.io.Serializable;
import java.util.ArrayList;
import cls.Powerup.PowerupEffect;
import btc.Main;
import scn.Game;
import lib.jog.graphics;
import lib.jog.input;
import lib.jog.window;
import lib.jog.graphics.Image;
import lib.jog.input.EventHandler;
public class Airport ... | src/cls/Airport.java | 0.66236 | 0.411406 | Airport.java | starcoder |
package dev.bitbite.networking;
import java.util.ArrayList;
import dev.bitbite.networking.exceptions.LayerDisableFailedException;
import dev.bitbite.networking.exceptions.LayerInitFailedException;
/**
* Keeps track of all {@link DataProcessingLayer}s and processes
* data by passing it to each layer and returning i... | src/main/java/dev/bitbite/networking/DataPreProcessor.java | 0.861974 | 0.411584 | DataPreProcessor.java | starcoder |
package com.microsoft.recognizers.text.datetime.german.parsers;
import com.google.common.collect.ImmutableMap;
import com.microsoft.recognizers.text.datetime.german.extractors.GermanHolidayExtractorConfiguration;
import com.microsoft.recognizers.text.datetime.parsers.BaseHolidayParserConfiguration;
import com.microso... | Java/libraries/recognizers-text-date-time/src/main/java/com/microsoft/recognizers/text/datetime/german/parsers/GermanHolidayParserConfiguration.java | 0.874426 | 0.409221 | GermanHolidayParserConfiguration.java | starcoder |
package br.com.eventhorizon.edx.ucsandiego.algs204x.pa2;
import br.com.eventhorizon.common.pa.FastScanner;
import br.com.eventhorizon.common.pa.PA;
import java.util.*;
import java.util.stream.Collectors;
public class BWTMatching implements PA {
@Override
public void naiveSolution() {
FastScanner scanner = n... | EDX/UCSanDiego-AlgorithmsAndDataStructures/ALGS204x-StringProcessingAndPatternMatchingAlgorithms/src/main/java/br/com/eventhorizon/edx/ucsandiego/algs204x/pa2/BWTMatching.java | 0.879561 | 0.421135 | BWTMatching.java | starcoder |
package org.xblackcat.sjpu.util.function;
import java.util.Objects;
import java.util.function.BiFunction;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.function.Supplier;
/**
* Represents a predicate (boolean-valued function) of one argument.
* <p>
* <p>This is a <a href... | src/java/org/xblackcat/sjpu/util/function/PredicateEx.java | 0.94366 | 0.551876 | PredicateEx.java | starcoder |
package net.sf.l2j.gameserver.data.xml;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import net.sf.l2j.commons.data.xml.IXmlReader;
import net.sf.l2j.gameserver.data.SkillTable;
import net.sf.l2j.gameserver.model.L2Skill;
imp... | aCis_gameserver/java/net/sf/l2j/gameserver/data/xml/SkillTreeData.java | 0.831656 | 0.430566 | SkillTreeData.java | starcoder |
package com.mycompany.hw5;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.Comparator;
/*
Author: <NAME>
Date: 05/18/21
Purpose: Compare objects with the Comparator object in each method with a Comparator parameter as invoked by the main method
*/
public class HW5 {
public stati... | HW5.java | 0.655005 | 0.4184 | HW5.java | starcoder |
package uSearch;
import static org.junit.Assert.*;
import org.junit.Test;
public class ProductTest {
@Test
public void testProductData() {
String[] similar1 = { "Product1", "Product2" };
Product product1 = new Product("P1", "Product1", "Book", similar1, 4.5);
assertTrue(product1.getAsin().equals("... | uSearch/src/uSearch/ProductTest.java | 0.753739 | 0.41484 | ProductTest.java | starcoder |
package cell_society.backend.automata.grid_styles;
import cell_society.backend.automata.CellStructure;
import cell_society.backend.automata.Coordinate;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ThreadLocalRandom;
/**
* This class exists for the Grid to easily reference square pro... | src/cell_society/backend/automata/grid_styles/SquareStructure.java | 0.947039 | 0.575886 | SquareStructure.java | starcoder |
package org.cirdles.ambapo;
import java.math.BigDecimal;
import java.math.MathContext;
import java.math.RoundingMode;
import ch.obermuhlner.math.big.BigDecimalMath;
/**
*
* @author <NAME>
*/
public class UTMToLatLong {
private static final BigDecimal SCALE_FACTOR = new BigDecimal(0.9996);
private stat... | core/src/main/java/org/cirdles/ambapo/UTMToLatLong.java | 0.899242 | 0.462776 | UTMToLatLong.java | starcoder |
package com.edu.uj.sk.btcg.collections;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import com.google.common.base.Optional;
... | BusinessTestCasesGenerator/src/com/edu/uj/sk/btcg/collections/CCollections.java | 0.755637 | 0.495178 | CCollections.java | starcoder |
package walkingkooka.tree.expression;
import walkingkooka.Either;
import walkingkooka.convert.Converter;
import java.util.Objects;
/**
* A {@link Converter} that adds support for converting {@link ExpressionNumber} to a target type by passing
* the value from the {@link ExpressionNumber} to an intermediate {@link ... | src/main/java/walkingkooka/tree/expression/ExpressionNumberFromExpressionNumberNumberConverter.java | 0.917279 | 0.483587 | ExpressionNumberFromExpressionNumberNumberConverter.java | starcoder |
package euler.p059;
import static java.lang.Character.isLetterOrDigit;
import static java.lang.Character.isWhitespace;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import java.util.Set;
impo... | projecteuler.net/Euler/src/euler/p059/Euler59.java | 0.823364 | 0.415254 | Euler59.java | starcoder |
package reform.data.sheet;
import java.util.regex.Pattern;
public final class Calculator
{
private final static Pattern ZERO = Pattern.compile("0");
public static Value modulo(final Value lhs, final Value rhs)
{
if (lhs.type == Value.Type.String || rhs.type == Value.Type.String)
{
throw new SemanticExcepti... | reform-data/src/main/java/reform/data/sheet/Calculator.java | 0.815857 | 0.525612 | Calculator.java | starcoder |
package li.selman.jpbe.datastructure;
import java.util.Set;
import li.selman.jpbe.dsl.Expression;
/**
* An edge represents a set of programs which evaluate to a substring of the intended output string.
* An edge is part of a directed acyclic graph (DAG).
* <p>
* For example: Given input {@code i_1} and output {@c... | src/main/java/li/selman/jpbe/datastructure/Edge.java | 0.847779 | 0.642895 | Edge.java | starcoder |
package core;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class ArrayUtils
{
public static double computeAverageError(List<List<Double>> list1, List<List<Double>> list2) {
int nPts = list1.size();
double sumSqr = 0.0;
for (int pt_num = 0... | library/ComputerVision/src/main/java/computervision/core/ArrayUtils.java | 0.80479 | 0.448004 | ArrayUtils.java | starcoder |
package edu.mit.streamjit.api;
/**
* Represents a rate declaration, with min, max and average values.
*
* Note that the average rate may be dynamic even if the minimum and maximum
* rates are known (so long as they aren't equal).
*
* Zero rates are legal, representing sources or sinks whose processing is
* comp... | src/edu/mit/streamjit/api/Rate.java | 0.896399 | 0.517754 | Rate.java | starcoder |
package io.github.phantamanta44.libnine.util.math;
import io.github.phantamanta44.libnine.util.tuple.IPair;
import net.minecraft.util.math.Vec3i;
public class MathUtils {
public static final double R2D_D = 180D / Math.PI;
public static final double D2R_D = Math.PI / 180D;
public static final float PI_F =... | src/main/java/io/github/phantamanta44/libnine/util/math/MathUtils.java | 0.88495 | 0.706773 | MathUtils.java | starcoder |
package Tests;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.GregorianCalendar;
import org.junit.jupiter.api.Test;
import jeopardy.Question;
import jeopardy.Round;
class QuestionsTest {
// ch... | src/Tests/QuestionsTest.java | 0.505615 | 0.677407 | QuestionsTest.java | starcoder |
package com.powersurgepub.psutils2.records;
import com.powersurgepub.psutils2.strings.*;
import java.util.*;
/**
A rule for formatting a telephone
number field into a standard format. The standard format is
"aaa-xxx-nnnn", where "aaa" is the area code, "xxx" is the local
exchange, and "nnnn" is th... | src/com/powersurgepub/psutils2/records/USPhoneRule.java | 0.611498 | 0.433382 | USPhoneRule.java | starcoder |
package de.mrapp.android.adapter.datastructure;
import android.os.Parcel;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import de.mrapp.android.adapter.Filter;
import de.mrapp.android.adapter.FilterQuery;
import de.mrapp.android.adapter.Filterable;
import de.mrapp.util.ClassUtil;
import de.... | library/src/main/java/de/mrapp/android/adapter/datastructure/AppliedFilter.java | 0.934679 | 0.431704 | AppliedFilter.java | starcoder |
package info6205.virus.simulation.util;
import info6205.virus.simulation.entity.RoadArea;
import info6205.virus.simulation.map.GridElement;
import java.util.*;
public class Graph<E> {
private Map<E, List<E>> map;
private Queue<Node> queue;
private Stack<Node> stack;
public Graph(){
queue=new... | src/main/java/info6205/virus/simulation/util/Graph.java | 0.721154 | 0.464112 | Graph.java | starcoder |
package bubolo.graphics;
import com.badlogic.gdx.graphics.Camera;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import bubolo.util.GameLogicException;
import bubolo.util.TextureUtil;
import bubolo.world.entity.concrete.E... | bubolo/src/bubolo/graphics/EngineerSprite.java | 0.603932 | 0.420719 | EngineerSprite.java | starcoder |
package problems.java.arrays;
import java.util.Arrays;
public class DuplicatesAndMissing
{
static int missingNumberInSortedConsecutiveArray(int[] a)
{
// {4, 5, 6, 8, 9, 10, 11, 12, 13, 14}) == 7
int low = a[0], high = a[a.length - 1];
int highExpectedSum = high * (high + 1) / 2;
... | 2-content/14-Pure-Education/java-data-struc/java-problems/src/main/java/problems/java/arrays/DuplicatesAndMissing.java | 0.744378 | 0.61529 | DuplicatesAndMissing.java | starcoder |
package org.datalift.fwk.util.io;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import org.datalift.fwk.util.Env;
/... | framework/src/java/org/datalift/fwk/util/io/SwapOutputStream.java | 0.874346 | 0.414306 | SwapOutputStream.java | starcoder |
package TicTacToe;
import java.awt.Point;
import hsa2.GraphicsConsole;
import java.util.ArrayList;
/**
* A mesh2D of rects
*/
public class Grid {
int size;
int rSize;
SimpleRect[][] mesh;
/**
* Create a Grid with a rect size, width, and height
*
* @param size Width of the contain... | projects/TicTacToe/src/main/java/TicTacToe/Grid.java | 0.811303 | 0.53783 | Grid.java | starcoder |
package pt;
import static pt.Common.EPS;
import static pt.Hit.NO_HIT;
public class Triangle implements Shape {
public Material material;
public Vector v1 = Vector.ZERO;
public Vector v2 = Vector.ZERO;
public Vector v3 = Vector.ZERO;
public Vector n1 = Vector.ZERO;
public Vector n2 = Vector.ZE... | src/main/java/pt/Triangle.java | 0.8848 | 0.517571 | Triangle.java | starcoder |
package edu.psu.compbio.seqcode.gse.datasets.alignments;
import java.util.*;
import edu.psu.compbio.seqcode.gse.datasets.general.Region;
import edu.psu.compbio.seqcode.gse.utils.Pair;
/** Given a set of aligned regions between two genomes, stitch them together to
* get the optimal overall alignment between the two... | src/edu/psu/compbio/seqcode/gse/datasets/alignments/AlignmentStitcher.java | 0.61682 | 0.535281 | AlignmentStitcher.java | starcoder |
package playfair;
import common.Permutations;
import common.Utils;
public class Playfair {
static final int DIM = 5; // DIM = 6 works only with crib.
static final int[][] PERMUTATIONS = DIM == 5 ? Permutations.PERMUTATIONS5 : Permutations.PERMUTATIONS6;
static final int ALPHABET_SIZE = DIM == 5 ? 26 : 36... | Util/JavaCryptanalysis/src/playfair/Playfair.java | 0.609757 | 0.510619 | Playfair.java | starcoder |
package cn.edu.cug.cs.gtl.geom;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
public class Color extends Color4f {
private static final long serialVersionUID = 1L;
public Color(float r, float g, float b, float a) {
super(r, g, b, a);
}
public Color(float r... | common/src/main/java/cn/edu/cug/cs/gtl/geom/Color.java | 0.834778 | 0.405154 | Color.java | starcoder |
package com.esplibrary.data;
import com.esplibrary.utilities.Range;
/**
* Represents a Valentine One sweep definitions.
*/
public class SweepDefinition {
/**
* Payload data index constants to extract the Sweep index.
*/
private static final int SWEEP_DEF_INDEX_IDX = 0;
/**
* Payload data ... | ESPLibrary2.0/ESPLib/src/main/java/com/esplibrary/data/SweepDefinition.java | 0.892942 | 0.493042 | SweepDefinition.java | starcoder |
package org.overrun.swgl.core.gl;
import org.joml.Matrix3fc;
import org.joml.Matrix4fc;
import org.joml.Vector3fc;
import org.joml.Vector4fc;
import org.lwjgl.opengl.GL20C;
import org.lwjgl.opengl.GL21C;
import org.lwjgl.opengl.GL40C;
import java.nio.ByteBuffer;
import static org.lwjgl.opengl.GL40C.*;
import static ... | src/main/java/org/overrun/swgl/core/gl/GLUniform.java | 0.917774 | 0.610076 | GLUniform.java | starcoder |
package it.unive.lisa.util.datastructures.graph.algorithms;
import static java.lang.String.format;
import it.unive.lisa.util.collections.workset.WorkingSet;
import it.unive.lisa.util.datastructures.graph.Edge;
import it.unive.lisa.util.datastructures.graph.Graph;
import it.unive.lisa.util.datastructures.graph.Node;
i... | lisa/lisa-sdk/src/main/java/it/unive/lisa/util/datastructures/graph/algorithms/Fixpoint.java | 0.884489 | 0.630983 | Fixpoint.java | starcoder |
package mygame;
/*
<NAME> & <NAME>
April 5th, 2021
This class holds 3 values that represent the x, y, and z values of either the dimensions of an object or a position in a 3d space.
*/
public class SpaceDef {
private float x;
private float y;
private float z;
/**
* Primary const... | 3dAimTrainer/src/mygame/SpaceDef.java | 0.696371 | 0.489992 | SpaceDef.java | starcoder |
package com.oracle.truffle.regex.util;
import java.util.PrimitiveIterator;
public final class Abstract64BitSet {
private static long toBit(int b) {
return 1L << b;
}
public static boolean isEmpty(long bs) {
return bs == 0;
}
public static boolean isFull(long bs) {
return... | src/main/java/com/oracle/truffle/regex/util/Abstract64BitSet.java | 0.90913 | 0.477859 | Abstract64BitSet.java | starcoder |
package net.ricebean.tools.colorstrip.util;
import net.ricebean.tools.colorstrip.model.Patch;
import java.util.ArrayList;
import java.util.List;
/**
* Util class for creating predefined standard patches.
*/
public class PatchGroup {
/**
* Returns the patches of a tvi10 color strip.
* @return The TVI... | lib/src/main/java/net/ricebean/tools/colorstrip/util/PatchGroup.java | 0.721547 | 0.423935 | PatchGroup.java | starcoder |
package org.peidevs.waro.actor.util;
import java.util.*;
import java.util.stream.*;
import org.peidevs.waro.table.Hand;
public class Auditor {
private Set<Integer> gameObservedBids = new HashSet<>();
private Set<Integer> gameExpectedBids = new HashSet<>();
private Map<String, Set<Integer>> expectedBidsP... | src/main/java/org/peidevs/waro/actor/util/Auditor.java | 0.881322 | 0.531331 | Auditor.java | starcoder |
package string;
/**
* Created by gouthamvidyapradhan on 01/05/2018.
* Given a non-negative integer N, find the largest number that is less than or equal to N with monotone
* increasing digits.
(Recall that an integer has monotone increasing digits if and only if each pair of
adjacent digits x and y satisfy x <= ... | java/tag/string/MonotoneIncreasingDigits.java | 0.852184 | 0.605216 | MonotoneIncreasingDigits.java | starcoder |
package Codility;
import java.util.Arrays;
import java.util.Stack;
/*
https://app.codility.com/programmers/lessons/7-stacks_and_queues/fish/
You are given two non-empty arrays A and B consisting of N integers. Arrays A and B represent N voracious fish in a
river, ordered downstream along the flow of the river.
T... | src/Codility/Fish.java | 0.635109 | 0.754078 | Fish.java | starcoder |
package boofcv.alg.scene.vocabtree;
import boofcv.misc.BoofLambdas;
import boofcv.misc.BoofMiscOps;
import boofcv.struct.PackedArray;
import org.ddogleg.clustering.PointDistance;
import org.ddogleg.struct.DogArray;
import org.ddogleg.struct.DogArray_I32;
import org.ddogleg.struct.FastArray;
import static boofcv.misc.... | main/boofcv-recognition/src/main/java/boofcv/alg/scene/vocabtree/HierarchicalVocabularyTree.java | 0.811751 | 0.619788 | HierarchicalVocabularyTree.java | starcoder |
package org.jf.dexlib.Util;
/**
* Implementation of {@link Input} which reads the data from a
* <code>byte[]</code> instance.
*
* <p><b>Note:</b> As per the {@link Input } interface, multi-byte
* reads all use little-endian order.</p>
*/
public class ByteArrayInput
implements Input {
/** non-null; the d... | Android/DependenciesVectorAttackScanner/src/org/jf/dexlib/Util/ByteArrayInput.java | 0.903031 | 0.564819 | ByteArrayInput.java | starcoder |
package smile.base.mlp;
/**
* The output layer in the neural network.
*
* @author <NAME>
*/
public class OutputLayer extends Layer {
private static final long serialVersionUID = 2L;
/** The cost function. */
private final Cost cost;
/** The output activation function. */
private final OutputFu... | core/src/main/java/smile/base/mlp/OutputLayer.java | 0.952519 | 0.528655 | OutputLayer.java | starcoder |
package com.jsimforest;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.text.MessageFormat;
import java.text.SimpleDateFormat;
public class Configuration implements DataBaseInterface {
private double stepsPerSecond;
private int stepsNumber;
private Mode mode;
private int gridWidt... | src/main/java/com/jsimforest/Configuration.java | 0.898778 | 0.530966 | Configuration.java | starcoder |
package io.octoprime.utils;
import io.octoprime.algo.strings.UtilsString;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Random;
import java.util.stream.Stream;
public class UtilsArray {
private static Random _random = new Random();
public static int[] makeIntArray(Stream s) {
... | src/main/java/io/octoprime/utils/UtilsArray.java | 0.523177 | 0.464234 | UtilsArray.java | starcoder |
package no.uib.cipr.matrix.sparse;
import no.uib.cipr.matrix.NotConvergedException;
import no.uib.cipr.matrix.Vector;
/**
* Iteration monitor based on matrix norms. Extends the default linear iteration
* object to compare with the norm of the system matrix and the right hand side.
* Can often be a better convergen... | rebro/src/java/no/uib/cipr/matrix/sparse/MatrixIterationMonitor.java | 0.926412 | 0.740057 | MatrixIterationMonitor.java | starcoder |
package ir.soroushtabesh.tetris.models;
import java.io.Serializable;
public class BlockShape implements Cloneable, Serializable {
public static final BlockShape NULL = new BlockShape();
public static final BlockShape LEG_LEFT = new BlockShape(
new Vector2D(0, 0)
, new Vector2D(-1, 0)
... | src/main/java/ir/soroushtabesh/tetris/models/BlockShape.java | 0.838746 | 0.767603 | BlockShape.java | starcoder |
package tk.pratanumandal.expr4j;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import tk.pratanumandal.expr4j.common.Expr4jConstants;
import tk.pratanumandal.expr4j.common.MathExtras;
import tk.pratanumandal.expr4... | src/main/java/tk/pratanumandal/expr4j/OperatorRepository.java | 0.604516 | 0.482856 | OperatorRepository.java | starcoder |
package com.google.zxing.datamatrix.decoder;
import com.google.zxing.FormatException;
import com.google.zxing.common.BitMatrix;
final class BitMatrixParser {
private final BitMatrix mappingBitMatrix;
private final BitMatrix readMappingMatrix;
private final Version version;
BitMatrixParser(BitMatrix b... | src/StockIT-v1-release_source_from_JADX/sources/com/google/zxing/datamatrix/decoder/BitMatrixParser.java | 0.533397 | 0.416797 | BitMatrixParser.java | starcoder |
package de.uzl.itm.ncoap.application.linkformat;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
/**
* <p>A {@link LinkValue} is a representation of a single entry in a {@link LinkValueList}. It consist... | ncoap-core/src/main/java/de/uzl/itm/ncoap/application/linkformat/LinkValue.java | 0.874721 | 0.407982 | LinkValue.java | starcoder |
package com.cisco.flare.trilateral;
/**
* Static functions used for drawing fins
*/
public class FinDrawingPreferences {
private static FinDrawingPreferences instance;
private static double gravitationFactor = 0.5;
private static double nearSize = 40; // 100;
private static double farSize = 5; // 15;... | java/Trilateral/wear/src/main/java/com/cisco/flare/trilateral/FinDrawingPreferences.java | 0.929776 | 0.495728 | FinDrawingPreferences.java | starcoder |
package Game;
import Utility.Lab3Util;
import Utility.Point2;
import Utility.Vector2;
import java.awt.*;
public class GameBall {
/**
* Gravitational acceleration vector.
*/
private static final Vector2 G = new Vector2(0.0, 9.81);
/**
* The current position of the ball.
... | src/Game/GameBall.java | 0.922948 | 0.586878 | GameBall.java | starcoder |
package com.spread.math;
/**
* Vector implementation
*
* @author <NAME>
*/
public class Vector {
protected double[] components;
/**
* Create a vector of given dimension. NOTE: The supplied array of
* components must not be changed.
*
* @param comp
* ... | src/main/java/com/spread/math/Vector.java | 0.950261 | 0.462473 | Vector.java | starcoder |
package com.github.leeonky.util;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.List;
import static java.util.Arrays.asList;
public class NumberUtil {
private static final List<Class<?>> NUMBER_TYPES = asList(Byte.class, Short.class, Integer.class, Long.class,
Float.class,... | src/main/java/com/github/leeonky/util/NumberUtil.java | 0.905063 | 0.515254 | NumberUtil.java | starcoder |
package cellsociety.view;
import cellsociety.configuration.Game;
import cellsociety.model.*;
import javafx.geometry.Pos;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.BorderPane;
import javafx.scene.paint.Color;
import javafx.scene.shape.Polygon;
import javafx.scene.shape.Rectangle;
/**
* Mainvie... | src/cellsociety/view/MainView.java | 0.731442 | 0.425665 | MainView.java | starcoder |
import java.io.IOException;
import java.io.Writer;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map.Entry;
import java.util.TreeMap;
import java.util.TreeSet;
/**
* Data structure to store strings and their positions.
*/
public class Inve... | src/InvertedIndex.java | 0.842053 | 0.457016 | InvertedIndex.java | starcoder |
package com.aspose.slides.examples.charts;
import com.aspose.slides.*;
import com.aspose.slides.examples.RunExamples;
import java.awt.*;
public class AutomaticChartSeriescolor
{
public static void main(String[] args)
{
//ExStart:AutomaticChartSeriescolor
// The path to the documents director... | Examples/src/main/java/com/aspose/slides/examples/charts/AutomaticChartSeriescolor.java | 0.808672 | 0.438064 | AutomaticChartSeriescolor.java | starcoder |
package lombok;
/**
* Collection of action templates.
*/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class Actions {
/**
* Encapsulates a method that has no parameters and does not return a value
*/
public static abstract class Action0 {
public abstract void apply();
}
/**
* Encapsula... | src/core/lombok/Actions.java | 0.88104 | 0.507385 | Actions.java | starcoder |
package com.google.android.material.color;
/** Functions for blending in HCT and CAM16. */
final class Blend {
private static final float HARMONIZE_BLEND_AMOUNT = 0.25f;
private Blend() {}
/**
* Blend the design color's HCT hue towards the key color's HCT hue, in a way that leaves the
* original color re... | lib/java/com/google/android/material/color/Blend.java | 0.943269 | 0.562056 | Blend.java | starcoder |
package leetcode.medium;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Deque;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class P_207 {
enum State {
UNVISITED, VISITING, VISITED
}
... | Java/leetcode/medium/P_207.java | 0.713931 | 0.424114 | P_207.java | starcoder |
package interpreter;
public class Parser {
private String[] allStatements;
private AbstractSyntaxTree syntaxTree;
private Context context;
private int currentLine;
public Parser(Context context, AbstractSyntaxTree syntaxTree, String allStatements) {
this.context = context;
this.s... | Interpreter Memento Visitor/src/interpreter/Parser.java | 0.655887 | 0.458167 | Parser.java | starcoder |
package org.apache.nifi.security.util.crypto;
import java.util.concurrent.TimeUnit;
import org.bouncycastle.crypto.generators.Argon2BytesGenerator;
import org.bouncycastle.crypto.params.Argon2Parameters;
import org.bouncycastle.util.encoders.Hex;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Provide... | nifi-commons/nifi-security-utils/src/main/java/org/apache/nifi/security/util/crypto/Argon2SecureHasher.java | 0.954478 | 0.543469 | Argon2SecureHasher.java | starcoder |
package guepardoapps.timext.java;
public class TimeXt {
private double value;
public double GetValue() {
return this.value;
}
private TimeXtUnit unit;
public TimeXtUnit GetUnit() {
return this.unit;
}
public TimeXt(double value, TimeXtUnit unit) {
this.value = v... | lib/src/main/java/guepardoapps/timext/java/TimeXt.java | 0.870198 | 0.535038 | TimeXt.java | starcoder |
package chapter_03;
import java.util.Scanner;
/**
* Exercise **3.21
*
* (Science: Day Of The Week) Zeller's congruence is an algorithm developed by
* <NAME> to calculate the day of the week.
*
* <pre>
*
* The formula:
*
* 26(m + 1) k j
* h = ( q + ----------- + k + --- + --- + 5j ) %... | src/chapter_03/Exercise_3_21.java | 0.587707 | 0.469581 | Exercise_3_21.java | starcoder |
package com.chen.formdroid.utils;
import android.test.InstrumentationTestCase;
import android.util.Log;
import junit.framework.Assert;
/**
* Created by chen on 3/30/15.
*/
public class StringUtilsTest extends InstrumentationTestCase{
public void testIsEmptyOrWhiteSpace() {
try {
boolean isE... | formdroid/src/androidTest/java/com/chen/formdroid/utils/StringUtilsTest.java | 0.731826 | 0.432243 | StringUtilsTest.java | starcoder |
package com.jay.graph;
import java.util.*;
public class EvaluateDivision {
public class Node {
String key;
List<Edge> edges;
public Node(String key) {
this.key = key;
this.edges = new ArrayList<>();
}
}
public class Edge {
Node node;
... | src/main/java/com/jay/graph/EvaluateDivision.java | 0.886611 | 0.483039 | EvaluateDivision.java | starcoder |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.