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 io.deephaven.client.impl;
import io.deephaven.qst.array.Array;
import io.deephaven.qst.array.BooleanArray;
import io.deephaven.qst.array.ByteArray;
import io.deephaven.qst.array.CharArray;
import io.deephaven.qst.array.DoubleArray;
import io.deephaven.qst.array.FloatArray;
import io.deephaven.qst.array.Generic... | java-client/flight/src/main/java/io/deephaven/client/impl/FieldAdapter.java | 0.836354 | 0.464355 | FieldAdapter.java | starcoder |
package com.yu.algorithm;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
/**
* Created by wscrlhs on 2017/5/7.
*/
public class Sort {
/**
* 冒泡排序法
* 性能:最坏情况复杂度O(n²);每次迭代只交换一个元素,虽好情况性能O(n)
*
* @param numbers
*/
public void bubbleSort(int[] numbers) {... | Sort.java | 0.530966 | 0.414603 | Sort.java | starcoder |
package io.adaptivecards.objectmodel;
import android.util.Pair;
import org.junit.Assert;
import org.junit.Test;
import java.util.ArrayList;
public class ColumnPropertiesTest
{
static {
System.loadLibrary("adaptivecards-native-lib");
}
@Test
public void AllPropertiesTest() throws Exception... | source/android/adaptivecards/src/androidTest/java/io/adaptivecards/objectmodel/ColumnPropertiesTest.java | 0.803637 | 0.422266 | ColumnPropertiesTest.java | starcoder |
package io.xpring.xrpl.model;
import org.immutables.value.Value;
import org.xrpl.rpc.v1.OfferCreate;
import java.util.Optional;
/**
* Represents an OfferCreate transaction on the XRP Ledger.
* <p>
* An OfferCreate transaction is effectively a limit order.
* It defines an intent to exchange currencies, and create... | src/main/java/io/xpring/xrpl/model/XrpOfferCreate.java | 0.904411 | 0.463201 | XrpOfferCreate.java | starcoder |
package org.locationtech.geowave.core.store.adapter.statistics;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import org.locationtech.geowave.core.index.ByteArray;
import org.locationtech.geowave.core.index.Mergeable;
import org.locationtech.geowave.core.stor... | core/store/src/main/java/org/locationtech/geowave/core/store/adapter/statistics/RowRangeHistogramStatisticsSet.java | 0.895802 | 0.428592 | RowRangeHistogramStatisticsSet.java | starcoder |
package org.jdesktop.swingx.treetable;
/**
* A model for any columnar information of a tree node. It encapsulates
* the methods which a TreeTableModel must implement in addition to
* those of a TreeModel. It is used by a TreeTableModelAdapter to
* expose a TreeModel as a TreeTableModel. <p>
*
* @see org.jdeskto... | src/main/java/org/jdesktop/swingx/treetable/NodeModel.java | 0.932737 | 0.530236 | NodeModel.java | starcoder |
import java.util.Random;
/** This class is responsible for performing the neural network operations using the parameters passed
* in the main class. The weights and hidden nodes are initialized randomly. The run method is called
* and the sample data is passed through the number of iterations until they are d... | parityBit.java | 0.80765 | 0.656053 | parityBit.java | starcoder |
package org.geotools.geometry;
import java.awt.geom.Point2D;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import org.geotools.util.Utilities;
import org.opengis.geometry.DirectPosition;
import org.opengis.geometry.MismatchedDim... | src_geotools/org/geotools/geometry/DirectPosition2D.java | 0.946541 | 0.64027 | DirectPosition2D.java | starcoder |
package com.reades.mapthing;
import java.io.Serializable;
/**
* <p>A simple node class that holds references to a
* position and an identifier. You would <i>usually</i>
* want to extend this class to do something more
* clever, but this is also used internally to hold
* the transformed coordinates within a Polyg... | Processing/libraries/MapThing/src/com/reades/mapthing/Node.java | 0.911446 | 0.494873 | Node.java | starcoder |
package org.apache.stanbol.entityhub.servicesapi.model;
import java.util.Collection;
import java.util.Date;
import java.util.Enumeration;
import java.util.Iterator;
import org.apache.stanbol.entityhub.servicesapi.yard.Yard;
/**
* This interface is used by the Entityhub to define representations. It is used for
* a... | entityhub/generic/servicesapi/src/main/java/org/apache/stanbol/entityhub/servicesapi/model/Representation.java | 0.770637 | 0.472744 | Representation.java | starcoder |
package com.bjmasc.bfit.bodyweight.data.core;
public class CoreExerciseNotes {
public static String exerciseNotes(@CoreRetention.CoreExercise int exerciseType) {
switch (exerciseType) {
case CoreRetention.CRUNCH:
return "The crunch is one of the most basic core exercises in the... | bodyweight/src/main/java/com/bjmasc/bfit/bodyweight/data/core/CoreExerciseNotes.java | 0.729905 | 0.575797 | CoreExerciseNotes.java | starcoder |
package net.minecraft.src;
public class Vector3
{
public float x;
public float y;
public float z;
public Vector3()
{
}
public Vector3(float x, float y, float z)
{
set(x, y, z);
}
public void set(float x, float y, float z)
{
this.x = x;
this.y... | project/src-thx/common/net/minecraft/src/Vector3.java | 0.885235 | 0.558929 | Vector3.java | starcoder |
package AP_Assignment1;
import java.util.Scanner;
public class Assignment1_Main {
static Scanner input = new Scanner(System.in);
public static void main(String[] args) {
// inputting the number of patients
int numberOfPatients = input.nextInt();
int numberOfPatientsAdmitted = 0;
HealthCoordinator health... | Assignment1_Main.java | 0.589953 | 0.507019 | Assignment1_Main.java | starcoder |
package ch.assignment.entry;
import java.util.Objects;
/**
* CryptoCurrencyEntry class represent parsed data from the input file. It contain only the digitalCurrencySymbol and
* the quantity of coins at the moment invested in the market and stored on a digital wallet.
* Please note there is check of digitalCurrenc... | src/main/java/ch/assignment/entry/CryptoCurrencyEntry.java | 0.897364 | 0.523359 | CryptoCurrencyEntry.java | starcoder |
package hwo.kurjatturskat.util;
public class AccelerationEstimator {
// Acceleration constant
protected Double A;
private DragEstimator dragEstimator;
public AccelerationEstimator(DragEstimator dragEstimator) {
this.dragEstimator = dragEstimator;
}
public void estimateAccelerationCo... | java/src/main/java/hwo/kurjatturskat/util/AccelerationEstimator.java | 0.777638 | 0.566978 | AccelerationEstimator.java | starcoder |
package org.sosy_lab.cpachecker.cpa.invariants;
import java.math.BigInteger;
public interface CompoundIntervalManager {
CompoundInterval allPossibleValues();
CompoundInterval bottom();
CompoundInterval logicalFalse();
CompoundInterval logicalTrue();
CompoundInterval union(CompoundInterval pOperand1, C... | src/org/sosy_lab/cpachecker/cpa/invariants/CompoundIntervalManager.java | 0.929272 | 0.592991 | CompoundIntervalManager.java | starcoder |
package gov.sandia.cognition.framework.concurrent;
import gov.sandia.cognition.framework.CognitiveModelState;
import gov.sandia.cognition.framework.CognitiveModule;
import gov.sandia.cognition.framework.CognitiveModuleState;
/**
* The ConcurrentCognitiveModule interface extends the functionality of
* CognitiveModu... | Components/FrameworkCore/Source/gov/sandia/cognition/framework/concurrent/ConcurrentCognitiveModule.java | 0.891758 | 0.597579 | ConcurrentCognitiveModule.java | starcoder |
package tech.tablesaw.api.ml.classification;
import com.google.common.collect.Table;
import com.google.common.collect.TreeBasedTable;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import tech.tablesaw.api.CategoryColumn;
import tech.tablesaw.api.IntColumn;
import java.util.ArrayList;
import java.util.List;
import ... | smile/src/main/java/tech/tablesaw/api/ml/classification/CategoryConfusionMatrix.java | 0.884439 | 0.47098 | CategoryConfusionMatrix.java | starcoder |
package nonComparisonBasedSortingAlgorithms;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/**
COUNTING SORTING ALGORITHM:
It is an Integer Sorting Algorithm: We assume the values to be integers.
Counting Sort assumes that all the values are discrete and they are within ... | src/main/java/nonComparisonBasedSortingAlgorithms/CountingSortingAlgorithm.java | 0.785555 | 0.773943 | CountingSortingAlgorithm.java | starcoder |
package org.geotools.referencing.factory.gridshift;
import org.geotools.referencing.operation.builder.LocalizationGrid;
/**
* A NADCON localization grid
*
* @author <NAME> - GeoSolutions
* @author <NAME>
*/
public class NADConGridShift extends LocalizationGrid {
/**
* The minimum longitude value c... | src_geotools/org/geotools/referencing/factory/gridshift/NADConGridShift.java | 0.941975 | 0.459561 | NADConGridShift.java | starcoder |
package q1650;
import org.junit.runner.RunWith;
import q1600.Q1595_MinimumCostToConnectTwoGroupsOfPoints;
import util.runner.Answer;
import util.runner.LeetCodeRunner;
import util.runner.TestData;
import util.runner.data.DataExpectation;
/**
* [Hard] 1601. Maximum Number of Achievable Transfer Requests
* https://le... | src/main/java/q1650/Q1601_MaximumNumberOfAchievableTransferRequests.java | 0.809238 | 0.539165 | Q1601_MaximumNumberOfAchievableTransferRequests.java | starcoder |
package alexp.macrobase.evaluation.roc.util;
/**
* <p>All the array utilities we wished Java included.</p>
*/
public class ArrayUtils {
/**
* Unconstructable (no-op). (A private constructor is necessary
* because otherwise Java inserts a default public constructor.)
*/
private ArrayUtils() ... | alexp/src/main/java/alexp/macrobase/evaluation/roc/util/ArrayUtils.java | 0.897164 | 0.551332 | ArrayUtils.java | starcoder |
package modern.challenge;
import java.time.Instant;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.OffsetDateTime;
import java.time.OffsetTime;
import java.time.ZoneId;
import java.time.ZoneOffset;
import java.time.ZonedDateTime;
import java.util.Date;
import j... | Chapter03/P72_ConvertBetweenDateTemporal/src/modern/challenge/DateConverters.java | 0.908179 | 0.525247 | DateConverters.java | starcoder |
package org.springframework.binding.expression;
import org.springframework.util.Assert;
/**
* An expression variable.
* @author <NAME>
*/
public class ExpressionVariable {
private String name;
private String valueExpression;
private ParserContext parserContext;
/**
* Creates a new expression variable.
... | spring-binding/src/main/java/org/springframework/binding/expression/ExpressionVariable.java | 0.867542 | 0.422445 | ExpressionVariable.java | starcoder |
package com.business;
import java.util.Date;
import com.business.exception.BusinessHourCalculatorException;
import com.business.util.ConvertStringToDate;
/**
* Allows one to define the opening and closing time for each day and calculates
* the time when it's going to be ready the work
*
* @author Enrique
*
*... | src/main/java/com/business/BusinessHourCalculator.java | 0.872171 | 0.461077 | BusinessHourCalculator.java | starcoder |
package com.group144.zaicev;
/**
* Class for working with AVL Tree node any Types
*
* @param <Type> Type, which you want to use
*/
class AVLTreeNode<Type extends Comparable<Type>> implements Comparable<AVLTreeNode<Type>> {
private Type value;
private AVLTreeNode<Type> left;
private AVLTreeNode<Type> ri... | 2 semester/hw4/hw4.2/src/main/java/com/group144/zaicev/AVLTreeNode.java | 0.90046 | 0.433322 | AVLTreeNode.java | starcoder |
package net.minecraft.server;
import java.util.Random;
import java.util.UUID;
public class MathHelper {
public static final float a = c(2.0F);
private static final float[] b = new float[65536];
private static final int[] c;
public static float sin(float f) {
return MathHelper.b[(int) (f * 10... | Server/work/decompile-8eb82bde/net/minecraft/server/MathHelper.java | 0.825132 | 0.589953 | MathHelper.java | starcoder |
package edu.umich.eecs.soar.deltautil;
import java.util.ArrayList;
public class LearnConfig {
private boolean cognitive,
associative,
auto,
spreading;
private int chunkThreshold = 2;
public ArrayList<String> commands = null;
private String commandName = "";
/**
* Initialize a learning c... | Interface/DeltaInterface/src/edu/umich/eecs/soar/deltautil/LearnConfig.java | 0.823506 | 0.430925 | LearnConfig.java | starcoder |
* This is not the original file distributed by the Apache Software Foundation
* It has been modified by the Hipparchus project
*/
package org.hipparchus.analysis.solvers;
import org.hipparchus.RealFieldElement;
import org.hipparchus.analysis.RealFieldUnivariateFunction;
import org.hipparchus.exception.MathIllegalA... | hipparchus-core/src/main/java/org/hipparchus/analysis/solvers/BracketedRealFieldUnivariateSolver.java | 0.95619 | 0.529446 | BracketedRealFieldUnivariateSolver.java | starcoder |
package models;
import org.imgscalr.Scalr;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.awt.image.DataBuffer;
import java.awt.image.DataBufferByte;
import java.awt.image.DataBufferInt;
import java.io.File;
import java.io.IOException;
/**
* Picture class. Holds the matrix of all the... | src/models/Picture.java | 0.868325 | 0.48621 | Picture.java | starcoder |
package javafx.scene.image;
import com.sun.javafx.geom.Rectangle;
import com.sun.javafx.tk.Toolkit;
import javafx.geometry.Rectangle2D;
import javafx.util.Callback;
import java.lang.ref.WeakReference;
import java.nio.Buffer;
import java.nio.ByteBuffer;
import java.nio.IntBuffer;
import java.util.LinkedList;
import ja... | out/artifacts/BoardTest_jar2/javafx.graphics/javafx/scene/image/PixelBuffer.java | 0.964279 | 0.566198 | PixelBuffer.java | starcoder |
package settings;
import exceptions.SettingsException;
public class Color {
//COLOR
private final String inputColor;
private final String cubeColor;
private final String kernelColor;
private final String denseColor;
private final String pyramidColor;
private final String arrowColor;
//... | src/settings/Color.java | 0.841663 | 0.40248 | Color.java | starcoder |
package de.charite.compbio.jannovar.hgvs.bridge;
import de.charite.compbio.jannovar.hgvs.SequenceType;
import de.charite.compbio.jannovar.hgvs.nts.NucleotidePointLocation;
import de.charite.compbio.jannovar.hgvs.nts.NucleotideRange;
import de.charite.compbio.jannovar.reference.CDSPosition;
import de.charite.compbio.ja... | jannovar-htsjdk/src/main/java/de/charite/compbio/jannovar/hgvs/bridge/NucleotideLocationConverter.java | 0.807574 | 0.427277 | NucleotideLocationConverter.java | starcoder |
package org.apache.flink.streaming.examples.statemachine.dfa;
import org.apache.flink.streaming.examples.statemachine.event.EventType;
import java.util.Random;
/**
* The State captures the main functionality of the state machine. It represents
* a specific state in the state machine, and holds all transitions poss... | flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/statemachine/dfa/State.java | 0.902231 | 0.537527 | State.java | starcoder |
package leetcode.weekly_contests.weekly_70;
public class P_778 {
private static final int[][] DIRS = { { 0, 1 }, { 0, -1 }, { 1, 0 }, { -1, 0 } };
private static final class UnionFind {
private final int[] parent;
private final int[] size;
private int count;
private UnionFind... | Java/leetcode/weekly_contests/weekly_70/P_778.java | 0.799951 | 0.443781 | P_778.java | starcoder |
package self.kearse.mathapp;
import androidx.annotation.NonNull;
import java.util.ArrayList;
import java.util.List;
/**
* A representation of complex numbers and set of operations for interacting with them.
* @param <T> The numerical type for representing component values, logically should be either
* F... | app/src/main/java/self/kearse/mathapp/Complex.java | 0.883748 | 0.571438 | Complex.java | starcoder |
package com.axiastudio.zoefx.core.db;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* User: tiziano
* Date: 07/01/15
* Time: 13:17
*/
public abstract class AbstractManager<E> implements Manager<E>{
@Override
public List<E> getAll() {
return... | src/main/java/com/axiastudio/zoefx/core/db/AbstractManager.java | 0.925243 | 0.412412 | AbstractManager.java | starcoder |
package net.tascalate.concurrent;
import java.time.Duration;
import java.util.concurrent.Callable;
import java.util.concurrent.CompletionStage;
import java.util.concurrent.Executor;
import java.util.concurrent.RunnableFuture;
import java.util.concurrent.TimeUnit;
import java.util.function.Supplier;
/**
*
* Concret... | src/main/java/net/tascalate/concurrent/CompletableTask.java | 0.923717 | 0.444384 | CompletableTask.java | starcoder |
package co.ecg.jain_sip.sip.message;
import co.ecg.jain_sip.sip.SipFactory;
import co.ecg.jain_sip.sip.address.URI;
import co.ecg.jain_sip.sip.header.*;
import java.text.ParseException;
import java.util.List;
/**
* This interface provides factory methods that allow an application to create
* Request and Response m... | jain-sip/src/main/java/co/ecg/jain_sip/sip/message/MessageFactory.java | 0.886942 | 0.463809 | MessageFactory.java | starcoder |
package burlap.behavior.singleagent.vfa.common;
import burlap.behavior.singleagent.vfa.*;
import burlap.oomdp.core.states.State;
import burlap.oomdp.singleagent.GroundedAction;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* This class can be used to perform ... | Assignment4/BURLAP/src/burlap/behavior/singleagent/vfa/common/LinearFVVFA.java | 0.821975 | 0.545588 | LinearFVVFA.java | starcoder |
package org.im97mori.ble.android.peripheral.hilt.datasource;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertFalse;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.assertTrue;
import static org.im97mori.ble.android.peripheral.... | app/src/androidTestDebug/java/org/im97mori/ble/android/peripheral/hilt/datasource/DeviceSettingDataSourceTest.java | 0.84607 | 0.434281 | DeviceSettingDataSourceTest.java | starcoder |
package br.com.musicas.opus03;
import org.jfugue.Pattern;
public class Metais extends Estrutura{
@Override
public void inicio() {
partitura.add(new Pattern("V3 X[Volume]=7000 I[BRASS_SECTION]"));
}
@Override
public void primeiraParte() {
partitura.add(new Pattern("Ri Rq Ri Rq Ri Rq Ri Dqa80d0 Rw."), 1);
... | album1/workspace/Memorable/src/br/com/musicas/opus03/Metais.java | 0.671471 | 0.424591 | Metais.java | starcoder |
package org.chromium.distiller.webdocument;
import org.chromium.distiller.DomDistillerJsTestCase;
import com.google.gwt.dom.client.Document;
public class WebTextBuilderTest extends DomDistillerJsTestCase {
private static void addText(WebTextBuilder builder, String text, int tagLevel) {
builder.textNode(... | javatests/org/chromium/distiller/webdocument/WebTextBuilderTest.java | 0.825027 | 0.422386 | WebTextBuilderTest.java | starcoder |
package problem.p748shortestcompletingword;
/**
* 748. Shortest Completing Word
*
* https://leetcode-cn.com/problems/shortest-completing-word/
*
* Given a string licensePlate and an array of strings words, find the shortest completing word in words.
*
* A completing word is a word that contains all the letters... | leetcode-java/src/problem/p748shortestcompletingword/Solution.java | 0.906903 | 0.420897 | Solution.java | starcoder |
package Complex_numbers;
/**
* Data type for Complex numbers.
*
* The data type is "immutable" so once you create and initialize a Complex object, you cannot change it.
*
* * Class overview:
* Complex(double real, double imag) : Constructor with two parameters -> inizializza il numero complesso al valore re + im... | src/main/java/Complex_numbers/Complex.java | 0.957467 | 0.590159 | Complex.java | starcoder |
package com.lemmingapex.chudnovskyalgorithm;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;
import org.apfloat.Apfloat;
import org.apfloat.ApfloatMath;
import org.apfloat.ApintMath;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.*;
/*
... | src/main/java/com/lemmingapex/chudnovskyalgorithm/ChudnovskyAlgorithm.java | 0.8874 | 0.504578 | ChudnovskyAlgorithm.java | starcoder |
package org.carbonrom.colorutils.score;
import org.carbonrom.colorutils.hct.Cam16;
import org.carbonrom.colorutils.utils.ColorUtils;
import org.carbonrom.colorutils.utils.MathUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Given a large set of colors, r... | src/main/java/org/carbonrom/colorutils/score/Score.java | 0.919503 | 0.460228 | Score.java | starcoder |
package edu.neu.ccs.conflux.internal.policy;
import edu.columbia.cs.psl.phosphor.control.graph.BasicBlock;
import edu.columbia.cs.psl.phosphor.control.graph.DummyBasicBlock;
import edu.columbia.cs.psl.phosphor.control.graph.FlowGraph;
import edu.columbia.cs.psl.phosphor.control.graph.FlowGraphBuilder;
import edu.colum... | conflux-policies/src/main/java/edu/neu/ccs/conflux/internal/policy/FlowGraphUtil.java | 0.916647 | 0.619817 | FlowGraphUtil.java | starcoder |
package com.google.template.soy.jssrc.internal;
import static com.google.common.base.CaseFormat.LOWER_CAMEL;
import static com.google.common.base.CaseFormat.UPPER_CAMEL;
import static com.google.template.soy.jssrc.dsl.Expression.LITERAL_NULL;
import static com.google.template.soy.jssrc.dsl.Expression.ifExpression;
imp... | java/src/com/google/template/soy/jssrc/internal/NullSafeAccumulator.java | 0.856842 | 0.407333 | NullSafeAccumulator.java | starcoder |
package org.ddogleg.combinatorics;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.List;
/**
* <p>
* Computes the combinations of size k given a set S of size N. This can be done in the forward or reverse direction.
* A combination is defined is a unique subset of a list i... | src/org/ddogleg/combinatorics/Combinations.java | 0.879147 | 0.411761 | Combinations.java | starcoder |
public class LinkCutTreeConnectivity {
public static class Node {
Node left;
Node right;
Node parent;
boolean flip;
}
static void push(Node x) {
if (!x.flip)
return;
x.flip = false;
Node t = x.left;
x.left = x.right;
x.right = t;
if (x.left != null)
x.left.flip = !x.left.flip;
if (x.rig... | java/src/LinkCutTreeConnectivity.java | 0.720172 | 0.544014 | LinkCutTreeConnectivity.java | starcoder |
package com.acmerobotics.library.path;
import com.acmerobotics.library.localization.Pose2d;
import com.acmerobotics.library.path.parametric.CompositePath;
import com.acmerobotics.library.path.parametric.Marker;
import com.acmerobotics.library.path.parametric.ParametricPath;
import java.util.ArrayList;
import java.uti... | RobotLib/src/main/java/com/acmerobotics/library/path/Trajectory.java | 0.822332 | 0.51013 | Trajectory.java | starcoder |
package problem2;
import java.util.Objects;
/**
* Name: <NAME>
* NUID: 001561546
* Course: CS 5004
* Course Number: 38097
* Semester: Spring 2021
*
* This class represents a mail item with the width, height, depth and the recipient.
*/
public class MailItem {
private Integer width;
private Integer height... | Homework/HW2/src/main/java/problem2/MailItem.java | 0.898572 | 0.450662 | MailItem.java | starcoder |
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Solution to Day 8: Seven Segment Search.
*
* @author bluebillxp
*/
public class SevenSegmentDecoder {
private static class Digit {
final int value;
final String pattern;
final bool... | SevenSegmentDecoder.java | 0.897018 | 0.425128 | SevenSegmentDecoder.java | starcoder |
package org.jscience.economics.money;
import java.math.BigDecimal;
import java.math.MathContext;
import java.util.Locale;
import org.jscience.physics.unit.Dimension;
import org.jscience.physics.unit.PhysicalUnit;
import org.jscience.physics.unit.converter.UnitConverterImpl;
import org.jscience.physics.unit.format.Unit... | economics/src/main/java/org/jscience/economics/money/Currency.java | 0.945676 | 0.45048 | Currency.java | starcoder |
package main.java.IP.graph;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
/**
* https://leetcode.com/problems/course-schedule/
*
* 207. Course Schedule
* Medium
*
* 4329
*
* 187
*
* Add to List
*
* Share
* There are a total of numCourses course... | src/main/java/IP/graph/CourseSchedule1.java | 0.855972 | 0.548734 | CourseSchedule1.java | starcoder |
package com.fishercoder.solutions;
import java.util.HashMap;
import java.util.Map;
/**
* A strobogrammatic number is a number that looks the same when rotated 180 degrees (looked at upside down).
Write a function to count the total strobogrammatic numbers that exist in the range of low <= num <= high.
For example,... | src/main/java/com/fishercoder/solutions/_248.java | 0.917603 | 0.563738 | _248.java | starcoder |
package edu.kestrel.acl2.aij;
import java.math.BigInteger;
/**
* Representation of ACL2 integers.
* These are the values that satisfy {@code integerp}.
*/
public final class Acl2Integer extends Acl2Rational {
//////////////////////////////////////// private members:
/**
* Numeric value of this integ... | books/kestrel/java/aij/java/src/edu/kestrel/acl2/aij/Acl2Integer.java | 0.975414 | 0.51818 | Acl2Integer.java | starcoder |
package com.semester;
import java.util.*;
/*
* Design a class program in Java to calculate the discount given to a customer on purchasing LED TV. The program also displays the amount paid by the customer after discount as following.
* Class Name: Television
* Data Members: cost (float), discount (float), am... | Lab5_Question1.java | 0.645343 | 0.542136 | Lab5_Question1.java | starcoder |
package dp;
public class Leetcode329LongestIncreasingPathinaMatrix {
/*
329. Longest Increasing Path in a Matrix
Given an m x n integers matrix, return the length of the
longest increasing path in matrix.
From each cell, you can either move in four directions: left, right, up, or dow... | arrows/src/main/java/dp/Leetcode329LongestIncreasingPathinaMatrix.java | 0.715921 | 0.692959 | Leetcode329LongestIncreasingPathinaMatrix.java | starcoder |
package hu.akarnokd.s4xmg.tutorial;
import static org.lwjgl.system.MemoryUtil.*;
import java.nio.*;
import static org.lwjgl.opengl.GL11.*;
import static org.lwjgl.opengl.GL15.*;
import static org.lwjgl.opengl.GL20.*;
import static org.lwjgl.opengl.GL30.*;
public class ShapeMesh {
final int vaoId;
final in... | src/main/java/hu/akarnokd/s4xmg/tutorial/ShapeMesh.java | 0.589716 | 0.470311 | ShapeMesh.java | starcoder |
package helicopterbattle;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
/**
* Enemy helicopter.
*
* @author www.gametutorial.net
*/
public class EnemyHelicopter {
// For creating new enemies.
private static final long timeBetweenNewEnemiesInit = Framework.secInNanosec * 3;
pu... | helicopterbattle/src/helicopterbattle/EnemyHelicopter.java | 0.810141 | 0.549943 | EnemyHelicopter.java | starcoder |
package org.hamcrest.core;
import org.junit.Assert;
import org.junit.Test;
import static org.hamcrest.AbstractMatcherTest.assertMismatchDescription;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.CombinableMatcher.both;
import static org.hamcrest.core.IsEqual.equalTo;
im... | hamcrest-1.3/hamcrest-unit-test/src/main/java/org/hamcrest/core/CombinableTest.java | 0.837321 | 0.409339 | CombinableTest.java | starcoder |
package tech.finnlestrange;
import java.util.ArrayList;
public class JavaDynamicArray {
// DIY Dynamic Array Class
class DynamicArray {
// Set to private so that instance variables cannot be directly referenced outside the class
private int size; // current size of dynamic array
priv... | dataStructures/src/tech/finnlestrange/JavaDynamicArray.java | 0.75274 | 0.561034 | JavaDynamicArray.java | starcoder |
package org.firstinspires.ftc.teamcode.TeleOp;
public class MecanumMath {
//===================================[Constants]===========================================
//change these constants if the robot is not behaving correctly!
private static final double[] verticalDrive = {-1, -1, -1, -1}; //the mot... | TeamCode/src/main/java/org/firstinspires/ftc/teamcode/TeleOp/MecanumMath.java | 0.875468 | 0.782787 | MecanumMath.java | starcoder |
package com.tokelon.toktales.android.render.opengl.gl20;
import javax.inject.Inject;
import com.tokelon.toktales.android.content.IAndroidBitmap;
import com.tokelon.toktales.core.content.graphics.IBitmap;
import com.tokelon.toktales.core.render.opengl.IGLErrorUtils;
import com.tokelon.toktales.core.render.texture.ITex... | tokTales-android/tokTales-android-library/src/main/java/com/tokelon/toktales/android/render/opengl/gl20/AndroidGLTextureDriver.java | 0.747524 | 0.415254 | AndroidGLTextureDriver.java | starcoder |
package org.tensorflow.keras.callbacks;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Callback that accumulates epoch averages of metrics.
*
*/
public class BaseLogger extends Callback {
/**
* List of string names of me... | src/main/java/org/tensorflow/keras/callbacks/BaseLogger.java | 0.916119 | 0.437223 | BaseLogger.java | starcoder |
package _210_coursescheduleii;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Queue;
import java.util.Set;
import java.util.stream.IntStream;
public class _210 {
public static void main(String[] args) {
ISolution s = new Solution2(... | algorithm/_210_coursescheduleii/_210.java | 0.679923 | 0.429908 | _210.java | starcoder |
package org.usfirst.frc.team224;
import edu.wpi.first.wpilibj.Joystick;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.stream.IntStream;
/**
* A class acting as an abstraction layer between a {@link Joystick} and a {@link Macro}.
* @author <NAME>
*/
class simulatedJoystick {
private fina... | src/main/java/org/usfirst/frc/team224/simulatedJoystick.java | 0.943725 | 0.461866 | simulatedJoystick.java | starcoder |
package com.jackwdev;
import java.util.Arrays;
public class MergeSort {
// Merge sort: Recursively divides the array, comparing subarrays and rebuilding a sorted array.
// Time Complexity: Best - O(n log(n)) Average - O(n log(n)) Worst - O(n log(n))
public static void mergeSort(int[] arr) {
//... | Java/src/com/jackwdev/MergeSort.java | 0.792946 | 0.697055 | MergeSort.java | starcoder |
package classic;
import util.Filler;
import util.RandomGenerator;
import java.util.Arrays;
import java.util.Comparator;
import java.util.function.Consumer;
public class Sort {
private static long cmpCount = 0;
private static long swapCount = 0;
public static <T extends Comparable<? super T>> void bubbl... | java/classic/Sort.java | 0.663015 | 0.459864 | Sort.java | starcoder |
package hu.supercluster.opengldemo.opengl.renderer;
import javax.microedition.khronos.opengles.GL10;
import hu.supercluster.opengldemo.opengl.mesh.AbstractMesh;
import hu.supercluster.opengldemo.opengl.mesh.Mesh;
import hu.supercluster.opengldemo.opengl.mesh.SmoothColoredCube;
import hu.supercluster.opengldemo.opengl... | app/src/main/java/hu/supercluster/opengldemo/opengl/renderer/OpenGLRenderer.java | 0.757436 | 0.520435 | OpenGLRenderer.java | starcoder |
package net.fornwall.jelf;
import java.io.IOException;
/**
* Class corresponding to the Elf32_Shdr/Elf64_Shdr struct.
*
* <p>
* An object file's section header table lets one locate all the file's sections. The section header table is an array
* of Elf32_Shdr or Elf64_Shdr structures. A section header table ind... | unidbg-android/src/main/java/net/fornwall/jelf/ElfSection.java | 0.773216 | 0.400573 | ElfSection.java | starcoder |
package com.aditya.personal.algorithmproblems.leetCode;
public class H_23_MergeKSortedLists {
private static class ListNode {
int val;
ListNode next;
ListNode(int val) {
this.val = val;
}
ListNode(int val, ListNode next) {
this.val = val;
... | src/main/java/com/aditya/personal/algorithmproblems/leetCode/H_23_MergeKSortedLists.java | 0.826782 | 0.440529 | H_23_MergeKSortedLists.java | starcoder |
package game;
import processing.core.PConstants;
public class ChargeBar {
static GameManager gm = GameManager.gm;
static float margin = 0.95f;
static float rectRoundness;
public Transform transform;
public int barCount = 10;
/* The colors of the bars when least, most & not charged. */
public Color least, mos... | src/game/ChargeBar.java | 0.571408 | 0.428951 | ChargeBar.java | starcoder |
package org.lwjgl.demo.intro;
import org.lwjgl.glfw.GLFW;
import static org.lwjgl.glfw.GLFW.*;
import static java.lang.System.*;
/**
* This is the first of a mini introductory series to working with LWJGL 3.
* <p>
* The purpose of this series is to get you comfortable with the concepts behind LWJGL 3. I... | src/org/lwjgl/demo/intro/Intro1.java | 0.59408 | 0.490053 | Intro1.java | starcoder |
package org.polypheny.db.plan;
/**
* RelTrait represents the manifestation of a relational expression trait within a trait definition. For example, a {@code CallingConvention.JAVA} is a trait of the {@link ConventionTraitDef} trait definition.
*
* <h3><a id="EqualsHashCodeNote">Note about equals() and hashCode()</... | core/src/main/java/org/polypheny/db/plan/RelTrait.java | 0.951459 | 0.525308 | RelTrait.java | starcoder |
package com.ppapp.geograph3d;
import android.util.Log;
import java.util.ArrayList;
public class JGraph extends JNativePointer {
// Конструктор
public JGraph() {
nativePointer = createGraph();
}
protected void finalize () {
clear(nativePointer);
destroyGraph(nativePointer);
... | geograph3d/android/example/app/src/main/java/com/ppapp/geograph3d/JGraph.java | 0.53048 | 0.540439 | JGraph.java | starcoder |
package edu.up.isgc.raytracer;
/**
*
* @author <NAME>
*/
/**
* Class creates a 3D vector and its able to calculate basic vector operations
*/
public class Vector3D {
private static final Vector3D ZERO = new Vector3D(0.0, 0.0, 0.0);
private double x, y, z;
/**
* Set and get methods to access cla... | src/edu/up/isgc/raytracer/Vector3D.java | 0.956523 | 0.757211 | Vector3D.java | starcoder |
import java.util.Arrays;
import java.lang.Math;
import java.util.Random;
class MaxSum {
public int left;
public int right;
public int sum;
MaxSum(int left, int right, int sum) {
this.left = left;
this.right = right;
this.sum = sum;
}
}
class MaximumSubarray {
/**
* This method implements t... | Divide_and_Conquer/MaximumSubarray.java | 0.781581 | 0.541651 | MaximumSubarray.java | starcoder |
package week7;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import adt.QueueADT;
import adt.errors.EmptyListError;
public class SLLQueueTest {
@Test
public... | test/week7/SLLQueueTest.java | 0.879936 | 0.630073 | SLLQueueTest.java | starcoder |
package com.github.jxen.math.rational;
import com.github.jxen.math.common.ArithmeticAware;
import com.github.jxen.math.common.MathUtil;
import com.github.jxen.math.rational.format.RationalFormat;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Objects;
import java.util.Optional;
/**
* {@co... | jxen-math/src/main/java/com/github/jxen/math/rational/BigRational.java | 0.954159 | 0.616388 | BigRational.java | starcoder |
package mil.nga.giat.geowave.core.index;
import java.nio.ByteBuffer;
import java.util.UUID;
import com.google.common.io.BaseEncoding;
/**
* Convenience methods for converting binary data to and from strings. The
* encoding and decoding is done in base-64. These methods should be used for
* converting data that is... | core/index/src/main/java/mil/nga/giat/geowave/core/index/ByteArrayUtils.java | 0.844505 | 0.427576 | ByteArrayUtils.java | starcoder |
package algorithms.graphs;
import algorithms.graphs.Dendogram.DendogramLayer;
import algorithms.misc.MinMaxPeakFinder;
import algorithms.util.SimpleLinkedListNode;
import gnu.trove.list.TFloatList;
import gnu.trove.list.TIntList;
import gnu.trove.list.array.TFloatArrayList;
import gnu.trove.list.array.TIntArrayList;
i... | src/main/java/algorithms/graphs/UnweightedGraphCommunityFinder.java | 0.863089 | 0.546012 | UnweightedGraphCommunityFinder.java | starcoder |
package LBJ2.nlp;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileFilter;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.Random;
import LBJ2.parse.Parser;
/**
... | src/main/java/LBJ2/nlp/WordsInDocumentByDirectory.java | 0.672439 | 0.401043 | WordsInDocumentByDirectory.java | starcoder |
package frc.robot;
import edu.wpi.first.math.geometry.Rotation2d;
import edu.wpi.first.math.geometry.Translation2d;
/**
* The Constants class provides a convenient place for teams to hold robot-wide numerical or boolean
* constants. This class should not be used for any other purpose. All constants should be declar... | src/main/java/frc/robot/Constants.java | 0.666497 | 0.427576 | Constants.java | starcoder |
package org.archive.wayback.util;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.charset.Charset;
/**
* Byte oriented static methods. Likely a lot of overlap with apache- commons
* stuff - eventually should be reconciled.
*
* @author brad
*
*/
public class ... | wayback-core/src/main/java/org/archive/wayback/util/ByteOp.java | 0.837852 | 0.474875 | ByteOp.java | starcoder |
package heronarts.lx.audio;
import heronarts.lx.modulator.LinearEnvelope;
import heronarts.lx.parameter.BasicParameter;
import ddf.minim.AudioSource;
import ddf.minim.analysis.FFT;
/**
* A graphic equalizer splits the signal into frequency bands and computes
* envelopes for each of the bands independently. It can a... | src/heronarts/lx/audio/GraphicEQ.java | 0.919231 | 0.441733 | GraphicEQ.java | starcoder |
package com.example.anan.AAChartCore.AAChartCoreLib.AAOptionsModel;
public class AAYAxis {
public AATitle title;
public AAPlotBandsElement[] plotBands;
public AAPlotLinesElement[] plotLines;
public String[] categories;
public Boolean reversed;
public Float gridLineWidth;// y 轴网格线宽度
public S... | app/src/main/java/com/example/anan/AAChartCore/AAChartCoreLib/AAOptionsModel/AAYAxis.java | 0.713531 | 0.590779 | AAYAxis.java | starcoder |
package org.xcsp.modeler.api;
import java.lang.reflect.Array;
import java.util.stream.IntStream;
import java.util.stream.Stream;
import org.xcsp.common.FunctionalInterfaces.IntToDomSymbolic;
import org.xcsp.common.FunctionalInterfaces.Intx2ToDomSymbolic;
import org.xcsp.common.IVar.VarSymbolic;
import org.xcsp.common... | src/main/java/org/xcsp/modeler/api/ProblemAPISymbolic.java | 0.858837 | 0.427935 | ProblemAPISymbolic.java | starcoder |
package org.jboss.dashboard.dataset.index;
import org.jboss.dashboard.profiler.ProfilerHelper;
import java.util.*;
public class LabelIndex implements ColumnIndex {
public DataSetIndex dataSetIndex = null;
public int column = -1;
public List<DistinctValue> disctinctValues = new ArrayList<DistinctValue>()... | modules/dashboard-providers/dashboard-provider-core/src/main/java/org/jboss/dashboard/dataset/index/LabelIndex.java | 0.790045 | 0.455925 | LabelIndex.java | starcoder |
package com.heatonresearch.aifh.learning;
import com.heatonresearch.aifh.general.VectorUtil;
import com.heatonresearch.aifh.general.fns.FnRBF;
import com.heatonresearch.aifh.general.fns.GaussianFunction;
import com.heatonresearch.aifh.randomize.GenerateRandom;
import java.util.Arrays;
/**
* A RBF network is an adva... | vol3/vol3-java-examples/src/main/java/com/heatonresearch/aifh/learning/RBFNetwork.java | 0.913739 | 0.55646 | RBFNetwork.java | starcoder |
package spacegame.random;
import com.badlogic.gdx.graphics.*;
import com.badlogic.gdx.graphics.g3d.Material;
import com.badlogic.gdx.graphics.g3d.ModelInstance;
import com.badlogic.gdx.graphics.g3d.attributes.TextureAttribute;
import com.badlogic.gdx.graphics.g3d.utils.MeshBuilder;
import com.badlogic.gdx.graphics.g3d... | src/main/java/spacegame/random/ShipGen.java | 0.704262 | 0.434761 | ShipGen.java | starcoder |
package utils;
import javafx.geometry.Bounds;
import javafx.geometry.Point2D;
import ui.custom.segline.SegLineGroup;
public class PointUtils {
public static double getCorrectedPointY(Bounds bounds, double y) {
double endPointY = y;
if (endPointY < 0) endPointY = 0;
if (endPointY > bounds.getHeight()) e... | src/main/java/utils/PointUtils.java | 0.686685 | 0.582461 | PointUtils.java | starcoder |
package ga.gussio.ld38.earthinvaders.buttons;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
import com.badlogic.gdx.math.Rectangle;
import com.... | core/src/ga/gussio/ld38/earthinvaders/buttons/Button.java | 0.768993 | 0.498169 | Button.java | starcoder |
package com.aaa.schooltracker.util.data;
import android.os.Parcel;
import android.os.Parcelable;
/**
* Contains all the data of a year
* @author <NAME>
* @version v1.0
*/
public class Year implements Parcelable {
// Field variables
private final int id;
private String schoolName;
private String ... | app/src/main/java/com/aaa/schooltracker/util/data/Year.java | 0.887235 | 0.409398 | Year.java | starcoder |
package seedu.revision.model;
import static java.util.Objects.requireNonNull;
import java.util.List;
import javafx.collections.ObservableList;
import seedu.revision.model.quiz.Statistics;
import seedu.revision.model.quiz.StatisticsList;
/**
* Wraps all data of statistics.
*/
public class History implements ReadOn... | src/main/java/seedu/revision/model/History.java | 0.802517 | 0.424233 | History.java | starcoder |
package org.eclipse.birt.chart.tests.engine.computation;
import junit.framework.TestCase;
import org.eclipse.birt.chart.computation.Vector;
import org.eclipse.birt.chart.model.attribute.impl.Angle3DImpl;
public class VectorTest extends TestCase
{
Vector v1, v2, v3;
/**
* Construct and initialize any objects th... | Corpus/birt/2485.java | 0.755547 | 0.574484 | 2485.java | starcoder |
package com.adobe.cq.wcm.core.components.models.datalayer.builder;
import com.adobe.cq.wcm.core.components.internal.models.v1.datalayer.builder.DataLayerSupplierImpl;
import com.adobe.cq.wcm.core.components.models.datalayer.ComponentData;
import org.jetbrains.annotations.NotNull;
import java.util.Date;
import java.ut... | bundles/core/src/main/java/com/adobe/cq/wcm/core/components/models/datalayer/builder/GenericComponentDataBuilder.java | 0.935759 | 0.421314 | GenericComponentDataBuilder.java | starcoder |
package qub;
public interface Base64ByteEncodingTests
{
static void test(TestRunner runner)
{
runner.testGroup(Base64ByteEncoding.class, () ->
{
runner.test("create()", (Test test) ->
{
final Base64ByteEncoding encoding = Base64ByteEncoding.create();
... | tests/qub/Base64ByteEncodingTests.java | 0.801004 | 0.637271 | Base64ByteEncodingTests.java | starcoder |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.