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 grammar.rules;
import org.antlr.v4.runtime.tree.AbstractParseTreeVisitor;
/**
* This class provides an empty implementation of {@link RulesVisitor},
* which can be extended to create a visitor which only needs to handle a subset
* of the available methods.
*
* @param <T> The return type of the visit opera... | TranslationMethods/4thLab/src/grammar/rules/RulesBaseVisitor.java | 0.878092 | 0.431165 | RulesBaseVisitor.java | starcoder |
package io.izzel.taboolib.module.nms.nbt;
import io.izzel.taboolib.TabooLib;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.util.NumberConversions;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.regex.Pattern;
/**
* 物品 NBT 结构... | src/main/scala/io/izzel/taboolib/module/nms/nbt/NBTBase.java | 0.653569 | 0.429728 | NBTBase.java | starcoder |
package com.davidjohnburrowes.util;
import java.util.Arrays;
/**
* This is something like a string builder, but instead builds an array
* of bytes.
*/
public class ByteArrayBuilder {
/**
* Amount to realloc the buffer by
*/
private static final int REALLOC_SIZE = 1024;
/**
* The buffer we use to keep the... | src/main/java/com/davidjohnburrowes/util/ByteArrayBuilder.java | 0.874077 | 0.455441 | ByteArrayBuilder.java | starcoder |
package com.machinezoo.hookless.time;
import java.math.*;
import java.time.*;
import java.time.temporal.*;
import com.machinezoo.stagean.*;
/**
* Reactive version of {@link Duration}.
*/
@DraftApi("requires review")
@DraftCode("requires review")
@NoTests
@StubDocs
public abstract class ReactiveDuration {
final Rea... | src/main/java/com/machinezoo/hookless/time/ReactiveDuration.java | 0.84228 | 0.451992 | ReactiveDuration.java | starcoder |
package upatras.electricaldevicesimulation.simulationcore.enviromentbase;
import upatras.electricaldevicesimulation.simulationcore.DeviceSimulationInstance;
import upatras.electricaldevicesimulation.simulationcore.enviromentmodifiers.EnviromentEnviromentHeatTransfer;
import upatras.electricaldevicesimulation.simulatio... | ElectricalDeviceSimulation/src/main/java/upatras/electricaldevicesimulation/simulationcore/enviromentbase/BasicEnviroment.java | 0.591369 | 0.507446 | BasicEnviroment.java | starcoder |
package co.edu.uniandes.csw.carpooling.dtos;
import co.edu.uniandes.csw.carpooling.entities.CalificacionEntity;
import co.edu.uniandes.csw.carpooling.entities.NotificacionEntity;
import co.edu.uniandes.csw.carpooling.entities.ReservaEntity;
import co.edu.uniandes.csw.carpooling.entities.ViajeroEntity;
import java.io.S... | s1_carpooling-api/src/main/java/co/edu/uniandes/csw/carpooling/dtos/ViajeroDetailDTO.java | 0.576661 | 0.400486 | ViajeroDetailDTO.java | starcoder |
package edu.msu.cse.cops.server.consistency.versioning;
import java.util.Map;
import java.util.concurrent.atomic.AtomicReference;
/**
* This class implements logical clock abstraction. Logical clock is a mechanism for capturing
* chronological and causal relationships between events in a distributed system.
*
* <... | apps/COPS/cops/cops-server/src/main/java/edu/msu/cse/cops/server/consistency/versioning/LogicalClock.java | 0.960933 | 0.430746 | LogicalClock.java | starcoder |
class Solution {
public List<List<Integer>> threeSum(int[] nums) {
// sort the array
Arrays.sort(nums);
// result
List<List<Integer>> result = new LinkedList();
// go through all elements in the array
for(int i = 0; i < nums.length - 2; i++){
if(i == 0 |... | Medium/15 3Sum_A.java | 0.641535 | 0.570271 | 15 3Sum_A.java | starcoder |
package net.ibbaa.keepitup.ui.validation;
import android.os.Bundle;
import android.os.PersistableBundle;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.assertEquals;
import static or... | keepitupmain/src/androidTest/java/net/ibbaa/keepitup/ui/validation/ValidationResultTest.java | 0.831349 | 0.561034 | ValidationResultTest.java | starcoder |
package net.splatcraft.inkcolor;
import net.minecraft.util.DyeColor;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.ColorHelper;
import net.minecraft.util.registry.Registry;
import net.splatcraft.Splatcraft;
import net.splatcraft.registry.SplatcraftRegistries;
import net.splatcraft.util.C... | src/main/java/net/splatcraft/inkcolor/InkColors.java | 0.570212 | 0.457864 | InkColors.java | starcoder |
package org.ode4j.ode.internal;
import org.ode4j.math.DMatrix3C;
import org.ode4j.math.DVector3C;
import org.ode4j.ode.DCylinder;
import static org.ode4j.ode.OdeMath.*;
/**
* standard ODE geometry primitives: public API and pairwise collision functions.
*
* the rule is that only the low level primitive collisio... | ode4j/src/org/ode4j/ode/internal/DxCylinder.java | 0.667798 | 0.511412 | DxCylinder.java | starcoder |
package gov.sandia.cognition.statistics.distribution;
import gov.sandia.cognition.math.matrix.Vector;
import gov.sandia.cognition.statistics.SmoothUnivariateDistributionTestHarness;
import java.util.Random;
/**
* Unit tests for ParetoDistributionTest.
*
* @author krdixon
*/
public class ParetoDistributionTest
... | Components/LearningCore/Test/gov/sandia/cognition/statistics/distribution/ParetoDistributionTest.java | 0.902279 | 0.598635 | ParetoDistributionTest.java | starcoder |
package io.github.Bubblie.Merplings.mixin;
import java.util.Optional;
import java.util.function.Supplier;
import com.mojang.serialization.Codec;
import net.minecraft.entity.ai.brain.MemoryModuleType;
import net.minecraft.entity.ai.brain.sensor.Sensor;
import net.minecraft.entity.ai.brain.sensor.SensorType;
import n... | src/main/java/io/github/Bubblie/Merplings/mixin/EntityBrainHelpers.java | 0.895717 | 0.407363 | EntityBrainHelpers.java | starcoder |
package de.suzufa.screwbox.tiled.internal.entity;
import java.awt.Point;
import java.util.List;
public class ObjectEntity {
private boolean ellipse;
private int gid;
private double height;
private int id;
private String name;
private boolean point;
private List<Point> polygon;
private... | screwbox-tiled/src/main/java/de/suzufa/screwbox/tiled/internal/entity/ObjectEntity.java | 0.85149 | 0.444143 | ObjectEntity.java | starcoder |
package com.anji.roshambo;
/*
* Entrant: <NAME> (1) <NAME> (USA)
*
* Winner of the First International RoShamBo Programming Competition
*
* <NAME> (from: http://ofb.net/~egnor/iocaine.html)
*
* They were both poisoned.
*
* <NAME> is a heuristically designed compilation of strategies and meta-strategies,
... | 17-05-2017/neuralturingmachines-master/src/com/anji/roshambo/IocainePlayer.java | 0.735452 | 0.596962 | IocainePlayer.java | starcoder |
* Provides a collection of interfaces and classes that compose the Java Accessibility
* Utilities. The classes are used by Assistive Technologies, such as the screen
* readers which are used by those who are blind, and help provide access to GUI
* toolkits that implement the Java Accessibility API. An overview of... | src/jdk14-source/jdk.accessibility/com/sun/java/accessibility/util/package-info.java | 0.795102 | 0.714122 | package-info.java | starcoder |
package com.exilant.exility.core;
import java.util.ArrayList;
import java.util.List;
/**
* Split one row in an input grid into multiple rows in the output grid based on
* the value of a column that has a list of concatenated values. This process is
* same as de-aggregator. We retain this for downward compatibility... | grid/com/exilant/exility/core/SplitRows.java | 0.598312 | 0.477006 | SplitRows.java | starcoder |
package com.jiahaoliuliu.chapter1.arraysandstrings;
import org.junit.Test;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
/**
* Given two strings, write a method to decide if one is a permutation of the... | src/com/jiahaoliuliu/chapter1/arraysandstrings/Q2CheckPermutation.java | 0.888711 | 0.55646 | Q2CheckPermutation.java | starcoder |
package frc.robot;
import edu.wpi.first.math.kinematics.DifferentialDriveKinematics;
import edu.wpi.first.math.util.Units;
import edu.wpi.first.wpilibj.PneumaticsModuleType;
/**
* The Constants class provides a convenient place for teams to hold robot-wide numerical or boolean
* constants. This class should not be... | src/main/java/frc/robot/Constants.java | 0.68215 | 0.528898 | Constants.java | starcoder |
package fr.redstonneur1256.redutilities;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Pattern;
public class TimeUtils {
public static final TimeUtils english;
private static final Pattern amountPattern;
private static final Map<Character, Long> unit... | src/fr/redstonneur1256/redutilities/TimeUtils.java | 0.827515 | 0.458167 | TimeUtils.java | starcoder |
package com.github.ryan.data_structure.deque;
import java.util.NoSuchElementException;
/**
* Resizable-array implementation of the {@link Deque} interface. Array
* deques have no capacity restrictions; they grow as necessary to support
* usage. They are not thread-safe; in the absence of external
* synchronizatio... | src/main/java/com/github/ryan/data_structure/deque/ArrayDeque.java | 0.881538 | 0.528959 | ArrayDeque.java | starcoder |
package utils.scripts.pholus;
import java.util.List;
import models.ComparisonExperiment;
import models.Ponderation;
import models.User;
import org.easymock.EasyMock;
import org.junit.BeforeClass;
import org.junit.Test;
import play.test.Fixtures;
import play.test.UnitTest;
import utils.Factory;
import utils.experime... | test/utils/scripts/pholus/PholusOutputParserTest.java | 0.60778 | 0.401101 | PholusOutputParserTest.java | starcoder |
package archimulator.uncore.cache;
import archimulator.util.StorageUnit;
/**
* Cache geometry.
*
* @author <NAME>
*/
public class CacheGeometry {
private int size;
private int associativity;
private int lineSize;
private int lineSizeInLog2;
private int numSets;
private int numSetsInLog2;
... | src/main/java/archimulator/uncore/cache/CacheGeometry.java | 0.911884 | 0.452536 | CacheGeometry.java | starcoder |
package functionality;
public class Vector {
private double[] values;
//create an empty vector
public Vector(int size) {
values=new double[size];
for(int i=1;i<size()+1;i++){
set(i,0);
}
}
//create a vector with the given values
public Vector(double[] values) {
this.values=values;
}
//+++... | src/functionality/Vector.java | 0.529263 | 0.523481 | Vector.java | starcoder |
package com.example.stockmaster.entity.ma;
import android.util.Log;
import com.example.stockmaster.util.DateUtil;
import java.util.Date;
public class MaState {
public float price;
public float ma5;
public float ma10;
public float ma20;
public float ma30;
public float ma60;
private float ... | app/src/main/java/com/example/stockmaster/entity/ma/MaState.java | 0.719088 | 0.481149 | MaState.java | starcoder |
package com.linkedin.dagli.annotation.equality;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Marks a Dagli node deriving from AbstractProducer, such as a ... | annotation/src/main/java/com/linkedin/dagli/annotation/equality/ValueEquality.java | 0.912881 | 0.427636 | ValueEquality.java | starcoder |
package org.newspeaklanguage.compiler.parser;
import org.antlr.v4.runtime.tree.AbstractParseTreeVisitor;
/**
* This class provides an empty implementation of {@link NewspeakVisitor},
* which can be extended to create a visitor which only needs to handle a subset
* of the available methods.
*
* @param <T> The retu... | gen/org/newspeaklanguage/compiler/parser/NewspeakBaseVisitor.java | 0.886654 | 0.424233 | NewspeakBaseVisitor.java | starcoder |
package com.google.collide.shared.util;
import junit.framework.TestCase;
/**
* Unit Tests for TextUtility functions.
*/
public class TextUtilsTest extends TestCase {
public void testFindNextCharacterInclusive() {
String text = "à\n";
assertEquals(0, TextUtils.findNextCharacterInclusive(text, 0));
... | javatests/com/google/collide/shared/util/TextUtilsTest.java | 0.859796 | 0.410934 | TextUtilsTest.java | starcoder |
package io.github.seba244c.icespire.ecs.components;
import io.github.seba244c.icespire.ecs.Component;
/**
* Makes the entity useable as a cameara in the renderer.render function
* A camera is the object wich a player sees the world through
* @author Sebsa
* @since 1.0.1
*/
public class CCamera extends ... | src/main/io/github/seba244c/icespire/ecs/components/CCamera.java | 0.844232 | 0.462716 | CCamera.java | starcoder |
package edu.mit.csail.sdg.alloy4;
import java.awt.Color;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Insets;
import javax.swing.border.Border;
/**
* Graphical border on zero, one, two, three, or all four sides of a component.
* <p>
* <b>Thread Safety:</b> Can be called only by the AWT eve... | org.alloytools.alloy.core/src/main/java/edu/mit/csail/sdg/alloy4/OurBorder.java | 0.931416 | 0.484502 | OurBorder.java | starcoder |
package vapidsl.domain.number.bigdecimal;
import vapidsl.common.SingleCondition;
import vapidsl.domain.ConditionBinder;
import vapidsl.domain.number.bigdecimal.impl.BigDecimalValidation;
import java.math.BigDecimal;
import java.util.function.BooleanSupplier;
import java.util.function.Function;
import java.util.functi... | src/main/java/vapidsl/domain/number/bigdecimal/BigDecimalConditionBinder.java | 0.916351 | 0.466603 | BigDecimalConditionBinder.java | starcoder |
package com.jacobgen.microsoft.msword;
import com.jacob.com.*;
public class TickLabels extends Dispatch {
public static final String componentName = "Word.TickLabels";
public TickLabels() {
super(componentName);
}
/**
* This constructor is used instead of a case operation to
* turn a Dispatch object into a... | myffmpeg-java20140728/MySpeech/gensrc/com/jacobgen/microsoft/msword/TickLabels.java | 0.907878 | 0.401248 | TickLabels.java | starcoder |
package unalcol.optimization.selection;
import unalcol.optimization.solution.Solution;
import unalcol.optimization.*;
import unalcol.types.collection.vector.*;
import unalcol.random.integer.UniformIntegerGenerator;
/**
* <p>Title: Tournament</p>
* <p>Description: A tournament selection strategy. In this strategy ea... | resources/systems/optimization/src/unalcol/optimization/selection/Tournament.java | 0.869063 | 0.487734 | Tournament.java | starcoder |
package examples.anode;
import org.nd4j.base.Preconditions;
import org.nd4j.linalg.activations.IActivation;
import org.nd4j.linalg.api.ndarray.INDArray;
import org.nd4j.linalg.indexing.conditions.GreaterThanOrEqual;
import org.nd4j.linalg.indexing.conditions.LessThan;
import org.nd4j.linalg.lossfunctions.ILossFunction... | src/main/java/examples/anode/LossHuber.java | 0.92498 | 0.439206 | LossHuber.java | starcoder |
package org.apache.mahout.classifier;
import org.apache.mahout.math.DenseMatrix;
import org.apache.mahout.math.DenseVector;
import org.apache.mahout.math.Matrix;
import org.apache.mahout.math.Vector;
import com.google.common.base.Preconditions;
/**
* Defines the interface for classifiers that take input as a vector... | common/mahout-distribution-0.7-hadoop1/core/src/main/java/org/apache/mahout/classifier/AbstractVectorClassifier.java | 0.943413 | 0.783036 | AbstractVectorClassifier.java | starcoder |
package us.ihmc.sensorProcessing.simulatedSensors;
import java.util.Collection;
import java.util.concurrent.ConcurrentLinkedQueue;
import us.ihmc.euclid.matrix.Matrix3D;
import us.ihmc.euclid.referenceFrame.FrameVector3D;
import us.ihmc.euclid.referenceFrame.ReferenceFrame;
import us.ihmc.euclid.transform.RigidBodyTr... | ihmc-simulation-toolkit/src/main/java/us/ihmc/sensorProcessing/simulatedSensors/InverseDynamicsJointsFromSCSRobotGenerator.java | 0.851181 | 0.610512 | InverseDynamicsJointsFromSCSRobotGenerator.java | starcoder |
package jahmm;
import jahmm.calculators.RegularForwardBackwardCalculator;
import jahmm.calculators.RegularForwardBackwardCalculatorBase;
import jahmm.calculators.RegularForwardBackwardScaledCalculatorBase;
import jahmm.calculators.RegularViterbiCalculatorBase;
import jahmm.observables.Observation;
import jahmm.observa... | jahmm/src/jahmm/RegularHmmBase.java | 0.898182 | 0.562958 | RegularHmmBase.java | starcoder |
package com.elytradev.architecture.common.helpers;
import com.elytradev.architecture.common.ArchitectureLog;
import com.elytradev.architecture.common.ArchitectureMod;
public class Matrix3 {
public static Matrix3 ident = new Matrix3();
public static Matrix3[] turnRotations = {
rotY(0), rotY(90), ... | src/main/java/com/elytradev/architecture/common/helpers/Matrix3.java | 0.783243 | 0.481454 | Matrix3.java | starcoder |
package org.hawkular.metrics.tasks.api;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
import org.hawkular.metrics.tasks.impl.TaskImpl;
/**
* Tasks are grouped by type, and execution order is also determined by type. If there are types A, B, C, then for
* a given time slice all tasks of type A are... | task-queue/src/main/java/org/hawkular/metrics/tasks/api/TaskType.java | 0.803637 | 0.447279 | TaskType.java | starcoder |
package net.sourceforge.stripes.util;
import net.sourceforge.stripes.validation.BooleanTypeConverter;
import net.sourceforge.stripes.validation.DateTypeConverter;
import net.sourceforge.stripes.validation.LocalizableError;
import net.sourceforge.stripes.validation.ScopedLocalizableError;
import net.sourceforge.stripes... | tests/src/net/sourceforge/stripes/util/ResolverUtilTest.java | 0.811825 | 0.47244 | ResolverUtilTest.java | starcoder |
package ptrman.levels.visual;
import ptrman.Datastructures.IMap2d;
import ptrman.Datastructures.Map2d;
import ptrman.math.Maths;
/**
*
* from
* https://gist.github.com/naikrovek/643a9799171d20820cb9
* from
* http://stackoverflow.com/questions/5940188/how-to-convert-a-24-bit-png-to-3-bit-png-using-floyd-steinberg... | src/main/java/ptrman/levels/visual/Map2dDither.java | 0.823186 | 0.440409 | Map2dDither.java | starcoder |
package com.onehilltech.concurrent;
import java.util.concurrent.Executor;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
/**
* Execute a task, and retry the task if it fails up to N times. There is an
* optional interval for between retries that is only applicable when u... | concurrent-core/src/main/java/com/onehilltech/concurrent/Retry.java | 0.921468 | 0.401424 | Retry.java | starcoder |
package io.jeffrey.world.things.parts;
import java.util.ArrayList;
import java.util.Set;
import java.util.function.Consumer;
import java.util.function.Supplier;
import io.jeffrey.vector.VectorRegister3;
import io.jeffrey.world.data.EditBoolean;
import io.jeffrey.world.things.behaviors.HasActions;
import io.jeffrey.wo... | src/main/java/io/jeffrey/world/things/parts/PointSetPart.java | 0.801742 | 0.468365 | PointSetPart.java | starcoder |
package Algorithms;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* Add and delete intervals: Implement a data structure to support dynamic insertion, deletion of intervals. Overlapping intervals should be merged
see: http://en.wikipedia.org/wiki/Interval_tree
*/
public class Inte... | src/Algorithms/Intervals.java | 0.896512 | 0.524029 | Intervals.java | starcoder |
package com.freetymekiyan.algorithms.level.hard;
import org.junit.Test;
import java.util.LinkedList;
import java.util.List;
/**
* Given an array of words and a length L, format the text such that each line has exactly L characters and is fully
* (left and right) justified.
* <p>
* You should pack your words in a... | src/com/freetymekiyan/algorithms/level/Hard/TextJustification.java | 0.882162 | 0.488832 | TextJustification.java | starcoder |
package ibeeproject.model.soporte;
import java.awt.Color;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* AxisChart is the backend bean that supplies all the data for the axis
* chart.
*
* @since 1.5
*/
public class AxisChart {
//list of the Labels for the x axis of the... | Source/iBeeProject/src/java/ibeeproject/model/soporte/AxisChart.java | 0.764804 | 0.436682 | AxisChart.java | starcoder |
package org.opencv.core;
public class RotatedRect {
public double angle;
public Point center;
public Size size;
public RotatedRect() {
this.center = new Point();
this.size = new Size();
this.angle = 0.0d;
}
public RotatedRect(Point c, Size s, double a) {
this.c... | org/opencv/core/RotatedRect.java | 0.773131 | 0.527864 | RotatedRect.java | starcoder |
package accrue.cryptoerase.securityPolicy;
import java.io.Serializable;
import polyglot.util.CodeWriter;
import polyglot.util.InternalCompilerError;
import accrue.cryptoerase.CESecurityPolicyFactory;
import accrue.infoflow.analysis.SecurityPolicy;
/**
* Erasure security policies. They consist of a KindPolicy (indic... | src/accrue/cryptoerase/securityPolicy/CESecurityPolicy.java | 0.803058 | 0.439326 | CESecurityPolicy.java | starcoder |
package Main;
/**
*
*/
public class MathComplex {
/**
* Make addition of two complex numbers.
* @param a Complex number to make the addition.
* @param b Complex number to make the addition.
* @return Result of the addition of the two complex numbers.
*/
public static ComplexNumber c... | src/main/java/Main/MathComplex.java | 0.912521 | 0.639215 | MathComplex.java | starcoder |
package packSpecimenHierarchy;
/**
* Represents a WildDog object on the Serengeti Park.
*
* @version Project - Part 2
* @author <NAME>
*/
public class WildDog extends Carnivorous implements ExtinctionDanger {
// Attributes
private static final String WILDDOG_SOUND = "Aiiiiiiii aii aiii";
private stat... | code/src/packSpecimenHierarchy/WildDog.java | 0.921843 | 0.42471 | WildDog.java | starcoder |
package com.mckoi.data;
/**
* A KeyObjectDatabase is a transactional key/data (Key/DataFile) map. This
* interfaces exposes the process of creating and publishing/disposing an
* isolated transaction of a database.
*
* @author <NAME>
*/
public interface KeyObjectDatabase {
/**
* Returns a KeyObjectTransac... | src/main/java/com/mckoi/data/KeyObjectDatabase.java | 0.873498 | 0.415136 | KeyObjectDatabase.java | starcoder |
* 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 writing, software
* distributed u... | src/main/java/org/nomencurator/gui/swing/tree/NodeMapper.java | 0.947527 | 0.518424 | NodeMapper.java | starcoder |
package io.ultrabrew.metrics;
/**
* The base class of a system of measurement producing a single reportable metric. The system may
* consist of related measures that facilitates the quantification of some particular
* characteristic, but the end result is a single metric that is reported. Each measurement event is... | core/src/main/java/io/ultrabrew/metrics/Metric.java | 0.933764 | 0.457682 | Metric.java | starcoder |
package org.apache.cassandra.cql3;
import org.junit.Test;
/**
* Test column ranges and ordering with static column in table
*/
public class StaticColumnsQueryTest extends CQLTester
{
@Test
public void testSingleClustering() throws Throwable
{
createTable("CREATE TABLE %s (p text, c text, v text,... | test/unit/org/apache/cassandra/cql3/StaticColumnsQueryTest.java | 0.665628 | 0.407805 | StaticColumnsQueryTest.java | starcoder |
package com.solvd.university.model;
import java.util.List;
public class Course {
private Long id;
private String name;
private String creditHours;
private List<Term> terms;
private List<Prerequisite> prerequisits;
private List<Department> departments;
private List<CourseMaterial> courseMaterials;
private List... | src/src/main/java/com/solvd/university/model/Course.java | 0.641422 | 0.437523 | Course.java | starcoder |
package com.google.common.primitives;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import com.google.common.annotations.GwtCompatible;
import com.google.errorprone.annotations.CanIgnoreReturnValue;
import javax.annotation.CheckFor... | guava/src/com/google/common/primitives/UnsignedShort.java | 0.956735 | 0.618118 | UnsignedShort.java | starcoder |
package org.teavm.flavour.expr.type;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util... | expr/src/main/java/org/teavm/flavour/expr/type/TypeInference.java | 0.863593 | 0.481698 | TypeInference.java | starcoder |
package il.org.spartan.strings;
import java.util.*;
import org.jetbrains.annotations.*;
import il.org.spartan.streotypes.*;
import il.org.spartan.utils.*;
import nano.ly.*;
/** A utility class providing library functions that take an array or a
* collection of objects, and return a parenthesized {@link String} of ... | src/il/org/spartan/strings/Parenthesize.java | 0.856902 | 0.535159 | Parenthesize.java | starcoder |
package models.gtfs;
import java.util.*;
import org.onebusaway.gtfs.model.ShapePoint;
public class GtfsShapePoint {
/*
*shape_id
Required. The shape_id field contains an ID that uniquely identifies a shape.
shape_pt_lat
Required. The shape_pt_lat field associates a shape point's latitude with a shape ID. ... | app/models/gtfs/GtfsShapePoint.java | 0.82347 | 0.722649 | GtfsShapePoint.java | starcoder |
package cz.educanet.minesweeper.logic;
public class Minesweeper {
private final int rowsCount;
private final int columnsCount;
private Cells cells;
private final int bombCount;
private boolean loser = false;
private boolean winner = false;
private int x;
private int y;
//done
... | src/main/java/cz/educanet/minesweeper/logic/Minesweeper.java | 0.792665 | 0.522446 | Minesweeper.java | starcoder |
package me.retrodaredevil.game.trackshooter.util;
import com.badlogic.gdx.math.Vector2;
import java.util.Arrays;
import java.util.Objects;
public final class MathUtil {
private static final Vector2 temp = new Vector2();
/**
*
* @param a Number on the left of the MOD
* @param b Number on the right of the MOD... | core/src/me/retrodaredevil/game/trackshooter/util/MathUtil.java | 0.790732 | 0.700332 | MathUtil.java | starcoder |
class Sln1 {
public boolean canJump(int[] a) {
if (a.length <= 1)
return true;
int maxReach = 0;
int steps = 1;
for (int i = 0; i < a.length; i++) {
steps--;
if (i + a[i] > maxReach) {
maxReach = i + a[i];
steps = a[... | src/Interview_exp/goog/dp/AllJumpGame.java | 0.898966 | 0.554169 | AllJumpGame.java | starcoder |
package at.jku.cg.sar.pathfinder.astar;
import java.util.ArrayList;
import java.util.List;
import at.jku.cg.sar.pathfinder.PathFinder;
import at.jku.cg.sar.pathfinder.PathFinderResult;
import at.jku.cg.sar.pathfinder.PathFinderType;
import at.jku.cg.sar.pathfinder.problem.AStar;
import at.jku.cg.sar.pathfinder.proble... | src/at/jku/cg/sar/pathfinder/astar/AStarGlobalProb.java | 0.615435 | 0.434221 | AStarGlobalProb.java | starcoder |
package ca.cglab.jagl.graph;
import java.util.Collection;
/**
* In graph theory, a graph G is defined as a non-empty set of vertices and a set of edges.
* This interface specifies possible operations on all types of graphs.
* All graphs should be able to add/remove vertices/edges, provide an
* iterator over the c... | src/ca/cglab/jagl/graph/Graph.java | 0.873808 | 0.525308 | Graph.java | starcoder |
package org.libj.lang;
import static org.libj.lang.Assertions.*;
import java.io.IOException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.Enumeration;
import java.util.HashSet;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Predicate;
import or... | src/main/java/org/libj/lang/PackageLoader.java | 0.932126 | 0.436772 | PackageLoader.java | starcoder |
package binarytree;
import java.util.ArrayDeque;
import java.util.Queue;
public class Tree {
private Node root = null;
private Queue<Node> queue = new ArrayDeque<>();
private Node toBeTraversed;
private Node _previous;
public Node getRoot() {
return root;
}
public Tree(Node root... | ProblemSolving/src/binarytree/Tree.java | 0.63375 | 0.416678 | Tree.java | starcoder |
package umontreal.ssj.rng;
import java.io.Serializable;
/**
* Implements a RNG using the Rijndael block cipher algorithm (AES) with key
* and block lengths of 128 bits. A block of 128 bits is encrypted by the
* Rijndael algorithm to generate 128 pseudo-random bits. Those bits are
* split into four words of 32 bit... | src/main/java/umontreal/ssj/rng/RandRijndael.java | 0.889709 | 0.480113 | RandRijndael.java | starcoder |
package de.prkmd.behindthetables.data;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* Created by Patrick on 11.03.2017.
*/
public class TableEntry {
private String text;
private int entryPosition;
private int diceValue;
private int diceValueTo = -1;
// private static fin... | app/src/main/java/de/prkmd/behindthetables/data/TableEntry.java | 0.811751 | 0.415551 | TableEntry.java | starcoder |
package us.ihmc.commonWalkingControlModules.dynamicReachability;
public class SphereIntersectionTools
{
/**
* Computes the distance to the intersecting plane between two spheres. Sphere 1 is assumed to be the base sphere, and sphere 2 has it centered at a point
* separated from the base sphere by {@param sp... | ihmc-common-walking-control-modules/src/main/java/us/ihmc/commonWalkingControlModules/dynamicReachability/SphereIntersectionTools.java | 0.96598 | 0.907885 | SphereIntersectionTools.java | starcoder |
package net.jini.lookup;
/**
* The <code>ServiceDiscoveryListener</code> interface defines the methods used by objects such as a
* {@link net.jini.lookup.LookupCache LookupCache} to notify an entity that events of interest
* related to the elements of the cache have occurred. It is the responsibility of the entity
... | xap-core/xap-datagrid/src/main/java/net/jini/lookup/ServiceDiscoveryListener.java | 0.874921 | 0.645232 | ServiceDiscoveryListener.java | starcoder |
package compiler.vectorapi;
import jdk.incubator.vector.ByteVector;
import jdk.incubator.vector.VectorSpecies;
import jdk.incubator.vector.VectorShuffle;
import org.testng.Assert;
import org.testng.annotations.Test;
/*
* @test
* @bug 8265956
* @modules jdk.incubator.vector
* @run testng/othervm compiler.vectora... | test/hotspot/jtreg/compiler/vectorapi/TestVectorShuffleIotaByte.java | 0.68658 | 0.44565 | TestVectorShuffleIotaByte.java | starcoder |
package hu.webarticum.aurora.core.model.time;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class Interval implements Intervalable, TimeLimit, Comparable<Interval> {
private static final long serialVersionUID = 1L;
private final Time start;
private final Ti... | src/main/java/hu/webarticum/aurora/core/model/time/Interval.java | 0.904541 | 0.408808 | Interval.java | starcoder |
package com.github.sbridges.pasta.model.ltp.hn;
import com.github.sbridges.pasta.io.PstIo;
/**
* 2.3.1.1 HID
* A HID is a 4-byte value that identifies an item allocated from the heap.
* The value is unique only within the heap itself.
* The following is the structure of a HID.
*/
public class HNHDR {
... | src/main/java/com/github/sbridges/pasta/model/ltp/hn/HNHDR.java | 0.732879 | 0.428114 | HNHDR.java | starcoder |
package jsonvalues;
import java.math.BigInteger;
import java.util.Optional;
import java.util.function.Predicate;
import java.util.function.UnaryOperator;
import static java.util.Objects.requireNonNull;
/**
Represents an immutable json number of type BigInteger.
*/
public final class JsBigInt extends JsNumber impl... | src/main/java/jsonvalues/JsBigInt.java | 0.943945 | 0.533397 | JsBigInt.java | starcoder |
package edu.jhu.pacaya.hypergraph;
import java.io.Serializable;
import java.util.Arrays;
/** A hyperedge in a hypergraph. */
// We implement serializable to allow for easy deep copies when unit testing.
public class Hyperedge implements Serializable {
private static final long serialVersionUID = 1L;
private ... | src/main/java/edu/jhu/pacaya/hypergraph/Hyperedge.java | 0.91397 | 0.403743 | Hyperedge.java | starcoder |
package lpf.learn.leetcode.problems;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* 350. 两个数组的交集 II
* 给定两个数组,编写一个函数来计算它们的交集。
*
* 示例 1:
* 输入: nums1 = [1,2,2,1], nums2 = [2,2]
* 输出: [2,2]
*
* 示例 2:
* 输入: nums1 = [4,9,5], nums2 = [9,4,9,8,4]
* 输出: [4,... | src/main/java/lpf/learn/leetcode/problems/IntersectionOfTwoArraysII.java | 0.708616 | 0.496033 | IntersectionOfTwoArraysII.java | starcoder |
package org.cp.elements.lang;
import java.util.function.UnaryOperator;
import org.cp.elements.data.conversion.Converter;
/**
* The {@link Transformer} interface defines a contract for implementing {@link Class classes}
* who's {@link Object implementations} transform data from one value to another value
* of the ... | src/main/java/org/cp/elements/lang/Transformer.java | 0.956441 | 0.656906 | Transformer.java | starcoder |
package net.minecraft.client.renderer.culling;
import com.mojang.math.Matrix4f;
import com.mojang.math.Vector4f;
import net.minecraft.world.phys.AABB;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@OnlyIn(Dist.CLIENT)
public class Frustum {
public static final int ... | build/tmp/expandedArchives/forge-1.18.1-39.0.40_mapped_parchment_2021.12.19-1.18.1-sources.jar_8da1e53bade44c6d138d26d6ab1ad1d3/net/minecraft/client/renderer/culling/Frustum.java | 0.765681 | 0.452234 | Frustum.java | starcoder |
package edu.duke.cs.jflap.gui.viewer;
import edu.duke.cs.jflap.automata.State;
import edu.duke.cs.jflap.automata.Automaton;
import java.awt.Graphics;
import java.awt.Point;
import java.awt.Color;
import java.awt.geom.Rectangle2D;
/**
* The <CODE>StateDrawer</CODE> class handles the drawing of individual
* states.
... | jflaplib-core/src/main/java/edu/duke/cs/jflap/gui/viewer/StateDrawer.java | 0.69946 | 0.437763 | StateDrawer.java | starcoder |
package ca.eandb.jmist.framework.function;
import ca.eandb.jmist.framework.Function1;
import ca.eandb.jmist.math.MathUtil;
/**
* A piecewise linear <code>Function1</code>.
* @author <NAME>
*/
public final class PiecewiseLinearFunction1 implements Function1 {
/** Serialization version ID. */
private static fin... | jmist-core/src/main/java/ca/eandb/jmist/framework/function/PiecewiseLinearFunction1.java | 0.916444 | 0.509886 | PiecewiseLinearFunction1.java | starcoder |
package org.tribuo.common.nearest;
import com.oracle.labs.mlrg.olcut.util.Pair;
import com.oracle.labs.mlrg.olcut.util.StreamUtil;
import org.tribuo.Example;
import org.tribuo.Excuse;
import org.tribuo.ImmutableFeatureMap;
import org.tribuo.ImmutableOutputInfo;
import org.tribuo.Model;
import org.tribuo.Output;
import... | Common/NearestNeighbour/src/main/java/org/tribuo/common/nearest/KNNModel.java | 0.828245 | 0.522446 | KNNModel.java | starcoder |
package com.opengamma.strata.product.credit;
import static com.opengamma.strata.collect.Guavate.ensureOnlyOne;
import java.io.Serializable;
import java.time.LocalDate;
import java.util.List;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Optional;
import org.joda.beans.Bean;
import o... | modules/product/src/main/java/com/opengamma/strata/product/credit/ResolvedCdsIndex.java | 0.92376 | 0.552178 | ResolvedCdsIndex.java | starcoder |
package com.ermilitary.CosmoEscape.GameObject;
/**
* Created by Ermilashka on 03.04.2015.
*/
public class Collider extends Sprite {
public float sphere_collider = 0;
public Vector box_collider = new Vector(0,0,0);
public void setSphere(float sphere_collider){
this.sphere_collider = sphere_collid... | app/src/main/java/com/ermilitary/CosmoEscape/GameObject/Collider.java | 0.784608 | 0.47591 | Collider.java | starcoder |
package com.esri.core.geometry;
final class MathUtils {
/**
* The implementation of the Kahan summation algorithm. Use to get better
* precision when adding a lot of values.
*/
static final class KahanSummator {
private double sum; // the accumulated sum
private double compensati... | src/main/java/com/esri/core/geometry/MathUtils.java | 0.893129 | 0.589657 | MathUtils.java | starcoder |
package cellsociety.view;
import static org.junit.jupiter.api.Assertions.assertEquals;
import cellsociety.exception.InvalidSimGridDataException;
import cellsociety.exception.InvalidSimTypeException;
import cellsociety.exception.SimConfigurationMissingException;
import cellsociety.model.SimulationModel;
import cellsoc... | test/cellsociety/view/GraphViewTest.java | 0.813313 | 0.413122 | GraphViewTest.java | starcoder |
package graphics;
import math.Vector2f;
import math.Vector3f;
import utils.DataBufferUtils;
import utils.loaders.OBJLoader;
import java.nio.FloatBuffer;
import java.nio.IntBuffer;
import static org.lwjgl.opengl.GL33.*;
public class Mesh {
private String path;
private Vertex[] vertices;
private Vector2f... | src/main/java/graphics/Mesh.java | 0.626924 | 0.411406 | Mesh.java | starcoder |
package org.opensim.modeling;
/**
* The squared difference between a model frame's origin position and a<br>
* reference position value, summed over the frames for which a reference is<br>
* provided, and integrated over the phase. This can be used to track position<br>
* quantities in the model that don't corres... | Gui/opensim/modeling/src/org/opensim/modeling/MocoTranslationTrackingGoal.java | 0.93592 | 0.687879 | MocoTranslationTrackingGoal.java | starcoder |
package org.olap4j;
import java.util.List;
/**
* Listener interface for receiving events when the contents of a
* {@link CellSet} have changed.
*
* <p>NOTE: This functionality is experimental and is subject to change or
* removal without notice.
*
* <p>The client can ask the server to provide the listener with... | src/org/olap4j/CellSetListener.java | 0.92622 | 0.657483 | CellSetListener.java | starcoder |
public class Player {
/** A special player with an invalid ID and player type. */
public static Player NONE = new Player();
/** A unique constructor for the NONE player. */
private Player() {
this.id = -1;
this.name = "Nobody";
this.playerType = -1;
}
/** The number of... | src/Player.java | 0.892337 | 0.502991 | Player.java | starcoder |
package org.geotools.referencing.operation.matrix;
import org.opengis.referencing.operation.Matrix;
/**
* Static utility methods for creating matrix. This factory selects one of the {@link Matrix1},
* {@link Matrix2}, {@link Matrix3}, {@link Matrix4} or {@link GeneralMatrix} implementation
* according the... | src_geotools/org/geotools/referencing/operation/matrix/MatrixFactory.java | 0.939123 | 0.549943 | MatrixFactory.java | starcoder |
package org.hisp.dhis.android.core.category;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import android.support.test.runner.AndroidJUnit4;
import org.hisp.dhis.android.core.data.database.AbsStoreTestCase;
import org.junit.Before;... | core/src/androidTest/java/org/hisp/dhis/android/core/category/CategoryStoreShould.java | 0.874359 | 0.411229 | CategoryStoreShould.java | starcoder |
package org.firstinspires.ftc.teamcode.Autonomous.PurePursuit;
import java.util.ArrayList;
public class Geometry {
public static double distanceBetweenPoints(Point point1, Point point2) {
double hypotenuse = Math.hypot(point1.x - point2.x, point1.y - point2.y);
return hypotenuse;
}
public... | TeamCode/src/main/java/org/firstinspires/ftc/teamcode/Autonomous/PurePursuit/Geometry.java | 0.833325 | 0.719174 | Geometry.java | starcoder |
package com.bzh.gl.lesson8;
import android.opengl.GLES20;
import android.opengl.GLSurfaceView;
import android.opengl.Matrix;
import android.util.Log;
import com.bzh.gl.R;
import com.bzh.gl.RawResourceReader;
import com.bzh.gl.Utils;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.FloatBuffer;
... | OpenGLLesson/app/src/main/java/com/bzh/gl/lesson8/LessonEightRenderer.java | 0.914711 | 0.408395 | LessonEightRenderer.java | starcoder |
package com.google.zxing;
import com.google.zxing.common.BitArray;
import com.google.zxing.common.BitMatrix;
/**
* Represents an image bitmap of 1 bit data values.
* Reader objects accept AbstractBinaryBitmaps and attempt to decode it.
*
* @see BinaryBitmap for default implementation
*/
public interface Abstract... | core/src/main/java/com/google/zxing/AbstractBinaryBitmap.java | 0.944829 | 0.490541 | AbstractBinaryBitmap.java | starcoder |
package org.jcluster.fuzzykmeans;
import java.util.List;
import org.jcluster.dao.Center;
import org.jcluster.dao.Fuzzy;
import org.jcluster.dao.Point;
/**
* Implements the fuzzy c means algorithm
* @author <NAME>
* @since 19 May,2016
*/
public class FuzzyCMeans {
private int numOfClusters;
private double t... | src/main/java/org/jcluster/fuzzykmeans/FuzzyCMeans.java | 0.74382 | 0.459743 | FuzzyCMeans.java | starcoder |
package fundamentals.tree.bfs.lc107_binarytreelevelordertraversal2;
import fundamentals.tree.TreeNode;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.Queue;
/**
* Given a binary tree, return the bottom-up level order traversal of its no... | 1-algorithm/13-leetcode/java/src/fundamentals/tree/bfs/lc107_binarytreelevelordertraversal2/Solution.java | 0.904069 | 0.457803 | Solution.java | starcoder |
package com.miguelfonseca.completely.common;
import java.util.NoSuchElementException;
import javax.annotation.Nullable;
/**
* Condition that must be true prior to a routine's execution.
*/
public final class Precondition
{
@SuppressWarnings("checkstyle:leftcurly")
private Precondition() { };
/**
*... | core/src/main/java/com/miguelfonseca/completely/common/Precondition.java | 0.929224 | 0.435962 | Precondition.java | starcoder |
package fr.landel.utils.assertor.utils;
import java.util.Objects;
import java.util.function.BiPredicate;
import java.util.function.Predicate;
import fr.landel.utils.assertor.StepAssertor;
import fr.landel.utils.assertor.commons.ConstantsAssertor;
import fr.landel.utils.assertor.commons.MessageAssertor;
impor... | src/main/java/fr/landel/utils/assertor/utils/AssertorObject.java | 0.903177 | 0.579757 | AssertorObject.java | starcoder |
package com.ayoholdings.util;
import com.ayoholdings.model.ConversionCategory;
import com.ayoholdings.model.ConversionDTO;
import com.ayoholdings.model.ConversionFactor;
import com.ayoholdings.model.Measurement;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import ... | conversion-api/src/main/java/com/ayoholdings/util/ConversionUtil.java | 0.867682 | 0.408277 | ConversionUtil.java | starcoder |
package mygame.dualmarchingcubes;
import com.jme3.math.FastMath;
import com.jme3.math.Vector3f;
import com.jme3.renderer.Camera;
import com.jme3.scene.Geometry;
import com.jme3.scene.Mesh;
import com.jme3.scene.Node;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import... | Sample_Sources/jdualmarchingcube/IsoDualContour/src/mygame/dualmarchingcubes/Chunk.java | 0.776326 | 0.472744 | Chunk.java | starcoder |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.