code stringlengths 114 1.05M | path stringlengths 3 312 | quality_prob float64 0.5 0.99 | learning_prob float64 0.2 1 | filename stringlengths 3 168 | kind stringclasses 1
value |
|---|---|---|---|---|---|
package com.companies.meta;
import java.util.ArrayList;
import java.util.List;
import java.util.Stack;
/**
* 1762. Buildings With an Ocean View
* Medium
*
* 820
*
* 109
*
* Add to List
*
* Share
* There are n buildings in a line. You are given an integer array heights of size n that represents the heights ... | algorithms/src/com/companies/meta/BuildingsWithOceanView.java | 0.918759 | 0.411288 | BuildingsWithOceanView.java | starcoder |
package de.sonallux.spotify.api.models;
import lombok.*;
/**
* SectionObject
*/
@Getter
@Setter
@NoArgsConstructor
public class Section {
/**
* <p>The confidence, from 0.0 to 1.0, of the reliability of the section's "designation".</p>
*/
public float confidence;
/**
* <p>The dur... | spotify-web-api-java/src/main/generated/de/sonallux/spotify/api/models/Section.java | 0.799247 | 0.431764 | Section.java | starcoder |
package us.ihmc.pathPlanning.bodyPathPlanner;
import org.apache.commons.lang3.mutable.MutableDouble;
import us.ihmc.commons.MathTools;
import us.ihmc.euclid.geometry.Line2D;
import us.ihmc.euclid.geometry.Pose3D;
import us.ihmc.euclid.geometry.interfaces.Line2DReadOnly;
import us.ihmc.euclid.geometry.interfaces.Pose3D... | ihmc-path-planning/src/main/java/us/ihmc/pathPlanning/bodyPathPlanner/WaypointDefinedBodyPathPlanHolder.java | 0.888154 | 0.494934 | WaypointDefinedBodyPathPlanHolder.java | starcoder |
package io.piotrjastrzebski.dungen;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.ObjectMap;
/**
* Created by PiotrJ on 03/09/15.
*/
public class RoomGraph {
Array<RoomEdge> edges = new Array<>();
... | core/src/io/piotrjastrzebski/dungen/RoomGraph.java | 0.678753 | 0.419707 | RoomGraph.java | starcoder |
package com.problem.solving.dynamicprogramming;
import com.problem.solving.BaseProblem;
/*
ind the maximum length path (starting from any cell) such that all cells along the path are in increasing order
with a difference of 1. We can move in 4 directions from a given cell (i, j),
i.e., we can move to (i+1, j) or (... | src/com/problem/solving/dynamicprogramming/LongestPathMatrix.java | 0.706798 | 0.433981 | LongestPathMatrix.java | starcoder |
package OJSolution.feature.graph;
import java.util.*;
public class TopologicalSort {
private List<ArrayList> G;
private int[] visited;
//这个问题相当于查找一个循环是否存在于有向图中。如果存在循环,则不存在拓扑排序,因此不可能选取所有课程进行学习。
public void test() {
int n;
int[][] edges;
n = 4;
//edges =new int[][]{{1,0}... | feature/graph/TopologicalSort.java | 0.508544 | 0.521349 | TopologicalSort.java | starcoder |
package Motion.PIDDriveToPoint;
import com.qualcomm.robotcore.util.RobotLog;
import Hardware.Packets.HardwareData;
import Hardware.Packets.SensorData;
import Hardware.Robots.RobotConstants;
import MathSystems.MathUtils;
import MathSystems.PIDFSystem;
import MathSystems.PIDSystem;
import MathSystems.Vector3;
import Ma... | TeamCode/src/main/java/Motion/PIDDriveToPoint/PIDDriveToPoint.java | 0.754915 | 0.457924 | PIDDriveToPoint.java | starcoder |
package com.createchance.simplevideoeditor.gles;
import android.graphics.Bitmap;
import android.opengl.GLES20;
import com.createchance.simplevideoeditor.Logger;
import java.nio.FloatBuffer;
import static android.opengl.GLES20.GL_TEXTURE0;
import static android.opengl.GLES20.GL_TEXTURE1;
import static android.opengl... | simplevideoeditor/src/main/java/com/createchance/simplevideoeditor/gles/VideoFrameLookupFilter.java | 0.72662 | 0.4575 | VideoFrameLookupFilter.java | starcoder |
package com.interview.array;
/*
*
* https://leetcode.com/problems/maximum-product-subarray/
* Category: Medium, Must Do
* https://leetcode.com/problems/maximum-product-subarray/discuss/1608862/JAVA-or-3-Solutions-or-Detailed-Explanation-Using-Image
* Related:
* https://leetcode.com/problems/maximum-product-of-t... | src/com/interview/array/MaximumProductSubarray.java | 0.877798 | 0.435481 | MaximumProductSubarray.java | starcoder |
package com.obtuse.util;
import com.obtuse.exceptions.HowDidWeGetHereError;
import com.obtuse.util.gowing.*;
import com.obtuse.util.gowing.p2a.GowingEntityReference;
import com.obtuse.util.gowing.p2a.GowingUtil;
import com.obtuse.util.gowing.p2a.exceptions.GowingUnpackingException;
import com.obtuse.util.gowing.p2a.ho... | src/com/obtuse/util/TreeSorter.java | 0.892522 | 0.439146 | TreeSorter.java | starcoder |
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.util.Arrays;
import org.junit.Test;
/**
* From: https://github.com/atcoder/ac-library/blob/1ca9100261b8c27cf62acccc3618c5e8375bf57b/test/unittest/maxflow_test.cpp
*/
public class MaxFlowTest {
@Test
public v... | MaxFlow/MaxFlowTest.java | 0.836705 | 0.811601 | MaxFlowTest.java | starcoder |
package de.esri.osm.data;
import java.util.List;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import de.esri.osm.config.Field;
import de.esri.osm.config.Matching;
import de.esri.osm.config.Query;
/**
* Converts an OSM feature (JSON) to an ArcGIS feature (JSON).
*
* @auth... | Admin/OsmLib/src/de/esri/osm/data/OSMJSON2ArcGISJSONConverter.java | 0.734976 | 0.407982 | OSMJSON2ArcGISJSONConverter.java | starcoder |
package javastraw.matrices;
import javastraw.reader.block.ContactRecord;
import org.broad.igv.util.collections.FloatArrayList;
import org.broad.igv.util.collections.IntArrayList;
import java.util.Arrays;
import java.util.List;
public class SparseSymmetricMatrix implements BasicMatrix {
private final int numVal... | src/javastraw/matrices/SparseSymmetricMatrix.java | 0.677367 | 0.4917 | SparseSymmetricMatrix.java | starcoder |
package com.org.shark.graphtoolkits.simulation;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashSet;
import ... | src/main/java/com/org/shark/graphtoolkits/simulation/UserAgent.java | 0.702938 | 0.464234 | UserAgent.java | starcoder |
package br.com.codenation;
import java.time.LocalDate;
/**
* The type Time.
*/
public class Time {
// * Identificador do time
private Long id;
// Nome do Time
private String nome;
// Data de criação do time
private LocalDate dataCriacao;
// Cor do uniforme principal do time
privat... | src/main/java/br/com/codenation/Time.java | 0.824956 | 0.478773 | Time.java | starcoder |
package effectivejava.effectivejava;
/**
* Created by michaelngangom on 8/22/17.
*/
public class AllTopics {
private String topic;
private int topicNumber;
public void setTopicNumber(int topicNumber) {
this.topicNumber = topicNumber;
}
public String getTopic() {
return topic;
... | EffectiveJava/app/src/main/java/effectivejava/effectivejava/AllTopics.java | 0.780328 | 0.413832 | AllTopics.java | starcoder |
import java.io.*;
class transform {
public static void main(String[] args) throws IOException {
BufferedReader f = new BufferedReader(new FileReader("transform.in"));
PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("transform.out")));
int N = Integer.parseInt(f.readLine... | src/transform.java | 0.706596 | 0.450601 | transform.java | starcoder |
package com.elastisys.autoscaler.metricstreamers.influxdb.resultset;
import java.util.List;
import java.util.Objects;
import com.elastisys.scale.commons.json.JsonUtils;
/**
* Represents the results of a particular InfluxDB {@code SELECT} query.
*/
public class Result {
/**
* Contains an error message <i>... | metricstreamers/influxdb/src/main/java/com/elastisys/autoscaler/metricstreamers/influxdb/resultset/Result.java | 0.951097 | 0.433202 | Result.java | starcoder |
package com.seleniumtests.core;
import java.math.BigDecimal;
import java.text.DateFormat;
import java.text.ParseException;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
/**
* Provides mechanism to retrieve records from spreadsheets.
*/
... | src/main/java/com/seleniumtests/core/Filter.java | 0.854339 | 0.405419 | Filter.java | starcoder |
package com.asher_stern.crf.crf;
import java.lang.reflect.Array;
import java.math.BigDecimal;
import java.util.Collection;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.log4j.Logger;
import com.asher_stern.crf.crf.filters.CrfFeaturesAndFilters;
i... | src/main/java/com/asher_stern/crf/crf/CrfUtilities.java | 0.835584 | 0.45641 | CrfUtilities.java | starcoder |
package imj2.tools;
import static imj2.tools.BitwiseQuantizationTest.ColorTools1.min;
import static imj2.tools.BitwiseQuantizationTest.ColorTools1.packCIELAB;
import static imj2.tools.BitwiseQuantizationTest.ColorTools1.rgbToRGB;
import static imj2.tools.BitwiseQuantizationTest.ColorTools1.rgbToXYZ;
import stati... | test/imj2/tools/HighSegmentationLowLabelingTest.java | 0.530966 | 0.408336 | HighSegmentationLowLabelingTest.java | starcoder |
package org.broad.igv.blat;
import org.broad.igv.AbstractHeadlessTest;
import org.broad.igv.util.blat.BlatClient;
import org.junit.Test;
import java.util.List;
import static junit.framework.Assert.assertTrue;
/**
* @author jrobinso
* Date: 11/21/12
* Time: 9:23 PM
*/
public class BlatClientTest... | test/src/org/broad/igv/blat/BlatClientTest.java | 0.777511 | 0.534977 | BlatClientTest.java | starcoder |
package net.ezenity.reach.Fx.countdown;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Set;
import java.util.function.BiFunction;
/**
* CustomHashMap class is the Hash table based implementation of the Map interface. This class makes no
* guarantees as to the iteration order of the map, in pa... | src/main/java/net/ezenity/reach/Fx/countdown/CustomHashMap.java | 0.93286 | 0.406744 | CustomHashMap.java | starcoder |
package sg.danielneutrinos.jmdictlib.data;
import java.util.ArrayList;
import java.util.List;
/**
* Translational equivalent of the Japanese word,
* plus other related information. Where there
* are several distinctly different meanings of the word,
* multiple sense objects will be employed
*/
public class Sens... | src/main/java/sg/danielneutrinos/jmdictlib/data/Sense.java | 0.905725 | 0.51068 | Sense.java | starcoder |
package com.att.aro.core.videoanalysis.pojo;
import java.awt.image.BufferedImage;
import java.net.URI;
import java.util.ArrayList;
import java.util.SortedMap;
import java.util.TreeMap;
import org.springframework.util.CollectionUtils;
import com.att.aro.core.packetanalysis.pojo.ByteRange;
import com.att.aro.core.pack... | ARO.Core/src/main/java/com/att/aro/core/videoanalysis/pojo/VideoEvent.java | 0.641535 | 0.422505 | VideoEvent.java | starcoder |
package functiongroup;
import java.util.LinkedList;
import java.util.List;
/**
* Simple Java class to demonstrate the application of the logic
* in ABAP
*
* Nota bene: the naming of the class and the methods is not Java
* best practice, but has been chosen
* to match the naming in ABAP
*/
public class Z_FUNCGR... | src/main/java/functiongroup/Z_FUNCGRP.java | 0.718002 | 0.456168 | Z_FUNCGRP.java | starcoder |
package uk.org.glendale.worldgen.astro.stars;
import uk.org.glendale.utils.rpg.Die;
import uk.org.glendale.worldgen.astro.planets.codes.Temperature;
import uk.org.glendale.worldgen.astro.Physics;
import uk.org.glendale.worldgen.astro.systems.StarSystem;
import javax.persistence.*;
import static uk.org.glendale.world... | src/main/java/uk/org/glendale/worldgen/astro/stars/Star.java | 0.886482 | 0.631765 | Star.java | starcoder |
package com.googlecode.cqengine.index.compound.support;
import com.googlecode.cqengine.attribute.Attribute;
import com.googlecode.cqengine.query.option.QueryOptions;
import java.util.*;
/**
* A private implementation of {@link Attribute} used internally by
* {@link com.googlecode.cqengine.index.compound.CompoundIn... | code/src/main/java/com/googlecode/cqengine/index/compound/support/CompoundAttribute.java | 0.942261 | 0.435601 | CompoundAttribute.java | starcoder |
package ankel.advent2017;
import com.google.common.io.Resources;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.List;
import java.util.stream.Collectors;
/**
* a list of the offsets for each jump. Jumps are relative: -1 moves to the previous instruction, and 2 skips the next one. Start at ... | src/main/java/ankel/advent2017/Day5JumpInstruction.java | 0.814164 | 0.496826 | Day5JumpInstruction.java | starcoder |
package interview_questions.strings;
import java.math.BigInteger;
import java.util.Arrays;
public class RotateString {
/*
We are given two strings, A and B.
A shift on A consists of taking string A and moving the leftmost character to the rightmost position.
For example, if A = 'abcde', then it will be 'bcde... | Java/snippet/src/main/java/interview_questions/strings/RotateString.java | 0.870391 | 0.515681 | RotateString.java | starcoder |
package GiciFile.RawImage;
/**
* This class provide the mechanisms necessarys to do the conversion between the diferents modes
* of ordering the pixels of three-dimensional image.
*/
public class OrderConverter {
/**
* Represents the conversion of BIL to BSQ mode
*/
public static final int[] DIM_TRANSP_BIL_... | EMPORDA/src/GiciLibs/GiciFile/RawImage/OrderConverter.java | 0.852752 | 0.662373 | OrderConverter.java | starcoder |
package backtracks;
import java.util.ArrayList;
import java.util.List;
public class NQueenProblem {
/*
* Given a chess board of size N x N, determine how many ways N queens can be placed on this board
* so that no two queens attack each other.
*
*
* A queen can move horizontally, vertica... | src/backtracks/NQueenProblem.java | 0.87834 | 0.6805 | NQueenProblem.java | starcoder |
package com.sillysoft.lux;
import com.sillysoft.lux.agent.LuxAgent;
/** The Board is the connection between the game world and agents.
* Commands such as choosing countries or attacking are all ordered through calls to the Board
* during the proper turn phase. The Board also contains some methods for querying the ga... | src/com/sillysoft/lux/Board.java | 0.801004 | 0.558809 | Board.java | starcoder |
package pacioli.types.matrix;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import pacioli.ConstraintSet;
import pacioli.Pacioli;
import pacioli.PacioliException;
import pacioli.Substitution;
import pacioli.t... | src/pacioli/types/matrix/MatrixType.java | 0.780035 | 0.526891 | MatrixType.java | starcoder |
package exame;
/* ALtura da árvore: log(n+1) - 1 (de 0 a h,onde n é o numero total de nos
Numero total de nos: 2^(h+1)-1 - onde h é a altura de da àrvore
*/
import java.util.LinkedList;
import java.util.Queue;
import java.util.Stack;
public class BSTree<T extends Comparable<? super T>> {
private BSTNode<T> r... | Exercices/exame/BSTree.java | 0.591605 | 0.474327 | BSTree.java | starcoder |
import java.util.ArrayList;
public class Pivit {
private int size;
private Constants.GameMode gameMode;
private Constants.GameState gameState;
private String player_turn;
public String firstPromotePlayer = null;
private ArrayList<Piece> board = new ArrayList<>();
private ArrayList<Piece> captured = new A... | src/Pivit.java | 0.806014 | 0.460168 | Pivit.java | starcoder |
package tek.render;
import org.joml.Matrix4f;
import org.joml.Vector2f;
import org.joml.Vector3f;
import tek.Window;
public class Camera {
public static final Vector2f DEFAULT_SIZE = new Vector2f(160, 90);
//the camera worldspace variables
public Vector3f position;
public Vector2f size;
//the camera's attri... | src/tek/render/Camera.java | 0.609175 | 0.523542 | Camera.java | starcoder |
package com.github.tadukoo.util.functional.predicate;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import s... | TadukooFunctions/junit/com/github/tadukoo/util/functional/predicate/ThrowingPredicateTest.java | 0.590189 | 0.654598 | ThrowingPredicateTest.java | starcoder |
package com.github.lunatrius.core.util.vector;
public class Vector2f {
public static final float FLOAT_EPSILON = 10e-6f;
public float x;
public float y;
public Vector2f() {
this(0, 0);
}
public Vector2f(Vector2f vec) {
this(vec.x, vec.y);
}
public Vector2f(float num) ... | src/main/java/com/github/lunatrius/core/util/vector/Vector2f.java | 0.928757 | 0.810216 | Vector2f.java | starcoder |
package mazes.schematic;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.stream.Collectors;
import mazes.util.VectorUtil;
import util.Pair;
import util.StreamUtil;
public final class LaserCutSchematic implements Iterable<LaserCutPath> {
private final Collection... | src/mazes/schematic/LaserCutSchematic.java | 0.845433 | 0.437523 | LaserCutSchematic.java | starcoder |
package de.powerstat.fb.mini;
import java.util.Objects;
/**
* Energy in Wh.
*/
public class Energy implements Comparable<Energy>
{
/**
* Energy in Wh.
*/
private final long energyWh;
/**
* Constructor.
*
* @param energy Energy in Wh. (must be >= 0)
* @throws IndexOutOfBoundsException... | src/main/java/de/powerstat/fb/mini/Energy.java | 0.902912 | 0.535706 | Energy.java | starcoder |
package com.github.nduyhai.effective.methodcommon;
/**
* Item 10: Obey the general contract when overriding equals
*
* Not to override equals when:
*
* - Each instance of the class is inherently unique
*
* - There is no need for the class to provide a “logical equality” test
*
* - A superclass has already ove... | src/main/java/com/github/nduyhai/effective/methodcommon/EqualsApp.java | 0.901789 | 0.406391 | EqualsApp.java | starcoder |
package com.opengamma.engine.depgraph;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.Set;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.collect.Sets;
import com.opengamma.engine.MemoryUtils;
import com.opengamma.engine.funct... | projects/OG-Engine/src/main/java/com/opengamma/engine/depgraph/NextFunctionStep.java | 0.676727 | 0.403038 | NextFunctionStep.java | starcoder |
import java.util.HashMap;
import java.util.Map;
class TennisScoreSystem {
public static void main(String[] args) {
System.out.println(computePoints(args));
}
private static String computePoints(String[] wins) {
String result = "";
Map<String, Long> playerPointsMap = new HashMap<>()... | TennisScoreSystem.java | 0.521959 | 0.478651 | TennisScoreSystem.java | starcoder |
package edu.vanderbilt.isis.path_browsing;
public class PathBrowser {
public static int testInput(int value) {
int code;
if (value < 0) {
code = checkInputNegative(value); // value = { -32, ..., -1 }
}
else {
code = checkInputPositive(value); // value = { 0, ..., 31 }... | test/edu/vanderbilt/isis/path_browsing/PathBrowser.java | 0.604749 | 0.431524 | PathBrowser.java | starcoder |
package com.google.j2cl.transpiler.regression.mediumbridgesshard2;
import junit.framework.TestCase;
public class TestShard extends TestCase {
public void testShards() {
TestCase2414.test();
TestCase4438.test();
TestCase10365.test();
TestCase292.test();
TestCase3548.test();
TestCase4589.test(... | transpiler/javatests/com/google/j2cl/transpiler/regression/mediumbridgesshard2/TestShard.java | 0.519521 | 0.775647 | TestShard.java | starcoder |
package com.opengamma.strata.pricer.swaption;
import java.time.LocalDate;
import com.opengamma.strata.basics.currency.CurrencyAmount;
import com.opengamma.strata.basics.currency.MultiCurrencyAmount;
import com.opengamma.strata.basics.currency.Payment;
import com.opengamma.strata.collect.array.DoubleArray;
import com.... | modules/pricer/src/main/java/com/opengamma/strata/pricer/swaption/HullWhiteSwaptionPhysicalTradePricer.java | 0.925697 | 0.579668 | HullWhiteSwaptionPhysicalTradePricer.java | starcoder |
public class Actualizar
{
public double Tensor_R0(double escalar_anterior, double tasa_de_cambio_escalar, double tiempo )
{
return escalar_anterior + tasa_de_cambio_escalar*tiempo;
}
public double[] Tensor_R1(double[] vector_anterior, double[] tasa_de_cambio_vector, double tiempo )
{
... | Actualizar.java | 0.617397 | 0.597696 | Actualizar.java | starcoder |
import java.util.ArrayList;
public class Line {
public enum LineType {
HORIZONTAL,
VERTICAL,
DIAGONAL_RISING,
DIAGONAL_FALLING
}
private Coordinate m_start;
private Coordinate m_end;
private ArrayList<Coordinate> m_coordinates;
private LineType m_type;
publ... | Day5/Line.java | 0.801431 | 0.512632 | Line.java | starcoder |
package com.holonplatform.core.query;
import java.util.List;
import java.util.stream.Stream;
import com.holonplatform.core.exceptions.DataAccessException;
import com.holonplatform.core.property.Property;
import com.holonplatform.core.property.PropertyBox;
import com.holonplatform.core.property.PropertySet;
import com... | core/src/main/java/com/holonplatform/core/query/QueryProjectionOperations.java | 0.945976 | 0.474327 | QueryProjectionOperations.java | starcoder |
package gov.sandia.cognition.algorithm;
import gov.sandia.cognition.util.DefaultNamedValue;
import gov.sandia.cognition.util.NamedValue;
import java.util.ArrayList;
import java.util.Collection;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executors;
... | Components/CommonCore/Source/gov/sandia/cognition/algorithm/ParallelUtil.java | 0.931649 | 0.40645 | ParallelUtil.java | starcoder |
package us.zingalicio.toolman.util;
import java.util.ArrayList;
import org.spongepowered.api.block.BlockLoc;
import org.spongepowered.api.world.Location;
import org.spongepowered.api.world.extent.Extent;
import com.flowpowered.math.vector.Vector3d;
public class ShapeMaker
{
public ArrayList<BlockLoc> getCube(Bloc... | src/main/java/us/zingalicio/toolman/util/ShapeMaker.java | 0.642769 | 0.486332 | ShapeMaker.java | starcoder |
package com.battleship.asset;
import java.awt.Dimension;
import java.awt.Point;
/**
* <h1>GridCalculator</h1>
* <p>public abstract class GridCalculator</p>
*
* <p>
* GridCalculator is a class with function used for grid calculation
* management. For example, it write function to get cell under cursor etc.
... | src/com/battleship/asset/GridCalculator.java | 0.771757 | 0.519278 | GridCalculator.java | starcoder |
package wint.mvc.restful.method;
import wint.lang.utils.MapUtil;
import wint.mvc.flow.FlowData;
import wint.mvc.restful.method.impl.*;
import java.util.Map;
/**
* Created by songlihuang on 2018/3/7.
*/
public class NamedMethods {
private static Map<String, NamedMethod> namedMethods = MapUtil.newHashMap();
... | wint-framework/src/main/java/wint/mvc/restful/method/NamedMethods.java | 0.795102 | 0.439086 | NamedMethods.java | starcoder |
package org.evomaster.client.java.instrumentation.coverage.noninteger;
import org.evomaster.client.java.instrumentation.coverage.methodreplacement.DistanceHelper;
import org.evomaster.client.java.instrumentation.heuristic.TruthnessUtils;
import org.evomaster.client.java.instrumentation.staticstate.ExecutionTracer;
/*... | EvoMaster/client-java/instrumentation/src/main/java/org/evomaster/client/java/instrumentation/coverage/noninteger/NonIntegerComparisons.java | 0.870225 | 0.414543 | NonIntegerComparisons.java | starcoder |
package org.lwjgl.system.linux;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.MemoryStack.*;
/**
* Arguments for how {@code openat2(2)} should open the target path.
*
* <p>If only {@code f... | modules/lwjgl/core/src/generated/java/org/lwjgl/system/linux/OpenHow.java | 0.893606 | 0.442155 | OpenHow.java | starcoder |
package org.cloudbus.cloudsim.examples.mypower;
import lombok.Getter;
/**
* Specification of the VMs, defining the MIPS (Million Instructions Per Second) value and custom {@link AmplNetworkType},
* which will be used during the simulation.
* <br/><br/>
* In order to compare the CloudSim simulations with solution ... | cloudsim-cloudsim-4.0/modules/cloudsim-examples/src/main/java/org/cloudbus/cloudsim/examples/mypower/VmSpecification.java | 0.880463 | 0.442938 | VmSpecification.java | starcoder |
package org.insightcentre.uld.naisc.scorer;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import it.unimi.dsi.fastutil.doubles.DoubleArrayList;
import it.unimi.dsi.fastutil.doubles.DoubleList;
import java.util.Arrays;
import java.util.function.Function;
impo... | naisc-core/src/main/java/org/insightcentre/uld/naisc/scorer/LogGap.java | 0.843541 | 0.468061 | LogGap.java | starcoder |
package edu.ncsu.csc.nl.model.distance;
/**
* Contains different algorithms for computing the distance between two strings.
*
* Levenshtein Distance was taken from http://www.merriampark.com/ld.htm by <NAME>, who placed the source code
* into the public domain.
*
* @author John
*
*/
public class StringDist... | application/src/edu/ncsu/csc/nl/model/distance/StringDistance.java | 0.81593 | 0.546073 | StringDistance.java | starcoder |
package org.ltr4l.nn;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* NetworkShape parses the "layer" settings in the config file, and holds the information about
* the number of nodes and their activation in a layer.
* The default values are also provided.
*/
public class Networ... | src/main/java/org/ltr4l/nn/NetworkShape.java | 0.681833 | 0.474509 | NetworkShape.java | starcoder |
package fr.pyvain.websight.websight.Geometry;
import java.util.Collections;
import java.util.SortedSet;
import java.util.TreeSet;
/**
* <p>
* A class that represents an intersection between 2 or more
* Segment objects at a given CPoint.
* </p>
* <p>
* @author <NAME>, <EMAIL>
* </p>
*/
public final class Inte... | App/app/src/main/java/fr/pyvain/websight/websight/Geometry/Intersection.java | 0.939339 | 0.438905 | Intersection.java | starcoder |
package rx.internal.util;
import java.util.*;
import java.util.concurrent.atomic.AtomicReference;
import rx.exceptions.CompositeException;
/**
* Utility methods for terminal atomics with Throwables.
*
* @since 1.1.2
*/
public enum ExceptionsUtils {
;
/** The single instance of a Throwable indicatin... | src/main/java/rx/internal/util/ExceptionsUtils.java | 0.874305 | 0.402598 | ExceptionsUtils.java | starcoder |
package de.uni_heidelberg.cos.agw.ij.transform;
import net.imglib2.RealLocalizable;
import net.imglib2.RealPositionable;
import net.imglib2.realtransform.AffineTransform3D;
import net.imglib2.realtransform.RealTransform;
import net.imglib2.realtransform.RealTransformSequence;
import net.imglib2.realtransform.Translati... | src/main/java/de/uni_heidelberg/cos/agw/ij/transform/RotatableTranslatableRealTransform3D.java | 0.878796 | 0.490114 | RotatableTranslatableRealTransform3D.java | starcoder |
package com.google.v19.common.collect;
import static com.google.v19.common.base.Preconditions.checkArgument;
import static com.google.v19.common.base.Preconditions.checkElementIndex;
import static com.google.v19.common.base.Preconditions.checkNotNull;
import com.google.v19.common.annotations.Beta;
import com.google.v... | guava/src/com/google/v19/common/collect/ArrayTable.java | 0.855036 | 0.475423 | ArrayTable.java | starcoder |
import java.util.Random;
import java.util.Stack;
/**
* Uses "walkers" that randomly moves around a water filled map and adds lands
*/
public class MapWalker {
private static Random rnd = new Random();
//Land proportions
private final static double MIN_LAND_PROPORTION = 0.5;
private final static dou... | mapgen/MapWalker.java | 0.842086 | 0.474449 | MapWalker.java | starcoder |
package apps.graph;
import structures.graph.DirGraph;
import structures.linear.List;
import structures.linear.Stack;
import java.io.PrintWriter;
/**
* This class implements the Dijkstra's single-source shortest paths algorithm,
* on a directed graph with positive edge weights. The algorithm can be run
* with any s... | Textbook/src/apps/graph/ShortestPaths.java | 0.776962 | 0.513546 | ShortestPaths.java | starcoder |
package mobi.omegacentauri.ao.base;
/**
* Static methods for asserting that parameters or other variables equal
* specific values. This class is similar to the assert keyword in Java, except
* that it is always on (it does not require an -ea flag). Moreover, this class
* provides additional method for convenience... | app/src/mobi/omegacentauri/ao/base/Preconditions.java | 0.892234 | 0.41944 | Preconditions.java | starcoder |
package fi.aalto.ekanban.services;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static fi.aalto.ekanban.ApplicationConstants.ANALYSIS_PHASE_ID;
import static fi.aalto.ekanban.ApplicationConstants.DEVELOPMENT_PHASE_ID;
import java.util.Arrays;
import java.util.List... | backend/src/integration-test/java/fi/aalto/ekanban/services/GameServiceIntegrationTest.java | 0.631935 | 0.413536 | GameServiceIntegrationTest.java | starcoder |
package com.googlecode.totallylazy.time;
import com.googlecode.totallylazy.functions.Function1;
import com.googlecode.totallylazy.comparators.Maximum;
import com.googlecode.totallylazy.comparators.Minimum;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date... | ir/src/com/googlecode/totallylazy/time/Dates.java | 0.628635 | 0.494873 | Dates.java | starcoder |
package com.improvelectronics.sync.obex;
import android.os.Parcel;
import android.os.Parcelable;
import java.util.Date;
/**
* Class used to represent a item returned from an OBEX Folder Listing command that can either be a file or a folder.
* </p>
* To differentiate between a file and a folder, folder has a size ... | library/src/main/java/com/improvelectronics/sync/obex/OBEXFtpFolderListingItem.java | 0.822403 | 0.400046 | OBEXFtpFolderListingItem.java | starcoder |
package us.ihmc.sensorProcessing.stateEstimation.measurementModelElements;
import javax.vecmath.Matrix3d;
import javax.vecmath.Vector3d;
import us.ihmc.controlFlow.ControlFlowInputPort;
import us.ihmc.sensorProcessing.stateEstimation.evaluation.FullInverseDynamicsStructure;
import us.ihmc.robotics.linearAlgebra.Matri... | SensorProcessing/src/us/ihmc/sensorProcessing/stateEstimation/measurementModelElements/LinearAccelerationMeasurementModelJacobianAssembler.java | 0.846435 | 0.754418 | LinearAccelerationMeasurementModelJacobianAssembler.java | starcoder |
package com.bloc97.infiniview.SpaceGame;
import com.bloc97.infinisim.NBody.Equations;
import com.bloc97.infinisim.Spatial;
import com.bloc97.infiniview.SpaceGame.Objects.SpaceNatural;
import com.bloc97.uvector.Vector2;
import java.util.Date;
import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util... | InfiniView/src/main/java/com/bloc97/infiniview/SpaceGame/MercuryGRTest.java | 0.821438 | 0.482917 | MercuryGRTest.java | starcoder |
package base;
import java.util.ArrayList;
import java.util.Arrays;
public class Main {
/**
* # Lab Four
* ---
* <p>
* For this lab we're going to be making and using a bunch of functions.
* <p>
* Our Goals are:
* - Switch Case
* - Looping
* - Making our own functions
... | JavaLabs/Lab 4/src/base/Main.java | 0.600071 | 0.591251 | Main.java | starcoder |
import java.util.Arrays;
import java.util.Stack;
public class GrahamScan {
/*Graham's Scan
Problem (informal): Find convex hull surrounding a set of points
Algorithm: Find lowest point and sort remaining points by polar angle, push onto stack if left turn
Complexity:
* Time - O(nlogn) due to sorting... | Computational Geometry/GrahamScan.java | 0.524151 | 0.685921 | GrahamScan.java | starcoder |
package com.manvendrask.streamoperations;
import com.manvendrask.core.Programmer;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.Optional;
import java.util.OptionalInt;
import java.util.stream.IntStream;
import java.util.stream.Stream;
/**
* @author <NAME>
*/
public c... | src/com/manvendrask/streamoperations/ReductionOperation.java | 0.764716 | 0.475727 | ReductionOperation.java | starcoder |
M
方法1:
题目要求DFS。
其实basic implementation.每次处理node.left.next=node.right;node.right.next=node.next.left;
方法2:
不和题意,用了queue space,与Input成正比。太大。
BFS over Tree。 用Queue 和 queue.size(),老规矩。
process每层queue时,注意把next pointer加上去就好.
```
/*
Given a binary tree
... | java/sha/Java/Populating Next Right Pointers in Each Node.java | 0.784938 | 0.956594 | Populating Next Right Pointers in Each Node.java | starcoder |
package io.github.pr0methean.betterrandom.util;
import javax.annotation.Nullable;
/**
* Utility methods for working with binary and hex data.
*
* @author <NAME>
*/
public enum BinaryUtils {
;
// Mask for casting a byte to an int, bit-by-bit (with
// bitwise AND) with no special consideration for the sign b... | betterrandom/src/main/java/io/github/pr0methean/betterrandom/util/BinaryUtils.java | 0.951695 | 0.591605 | BinaryUtils.java | starcoder |
package edu.biu.scapi.primitives.dlog.openSSL;
import java.math.BigInteger;
import java.security.SecureRandom;
import org.bouncycastle.util.BigIntegers;
import edu.biu.scapi.primitives.dlog.GroupElementSendableData;
import edu.biu.scapi.primitives.dlog.ZpElementSendableData;
import edu.biu.scapi.primitives.dlog.ZpSa... | src/java/edu/biu/scapi/primitives/dlog/openSSL/OpenSSLZpSafePrimeElement.java | 0.663124 | 0.42674 | OpenSSLZpSafePrimeElement.java | starcoder |
package com.asher_stern.crf.crf;
import static com.asher_stern.crf.utilities.ArithmeticUtilities.*;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.conc... | src/main/java/com/asher_stern/crf/crf/CrfLogLikelihoodFunction.java | 0.76856 | 0.428891 | CrfLogLikelihoodFunction.java | starcoder |
package com.github.wrthomps.pavilion.builtin;
import java.util.function.BiFunction;
import java.util.function.Function;
import com.github.wrthomps.pavilion.domain.AbsoluteComparator;
import com.github.wrthomps.pavilion.domain.LocationMatchable;
import com.github.wrthomps.pavilion.domain.Matchable;
import com.... | src/main/java/com/github/wrthomps/pavilion/builtin/Builtins.java | 0.88282 | 0.434821 | Builtins.java | starcoder |
package com.jayantkrish.jklol.models.dynamic;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.SortedMap;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import com.google.common.base.Preconditions;... | src/com/jayantkrish/jklol/models/dynamic/VariableNamePattern.java | 0.919762 | 0.417331 | VariableNamePattern.java | starcoder |
package com.gauravbytes.algorithms.array.rotation;
import static java.lang.String.format;
import java.util.Arrays;
/**
*
* @author <NAME>
*
*/
public class ArrayRotationMain {
public static void main(String[] args) {
arrayRotationWithSpaceComplexity();
arrayRotationWithTimeComplexity();
arrayRotati... | algorithms/src/main/java/com/gauravbytes/algorithms/array/rotation/ArrayRotationMain.java | 0.757705 | 0.471832 | ArrayRotationMain.java | starcoder |
package lockvis.model;
import static org.junit.Assert.*;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.text.ParseException;
import java.util.List;
import java.util.stream.Collectors;
... | test/lockvis/model/TestVMThreadDumpFactory.java | 0.71602 | 0.438364 | TestVMThreadDumpFactory.java | starcoder |
package com.google.ortools.constraintsolver;
public interface RoutingSearchParametersOrBuilder extends
// @@protoc_insertion_point(interface_extends:operations_research.RoutingSearchParameters)
com.google.protobuf.MessageOrBuilder {
/**
* <pre>
* First solution strategies, used as starting point of l... | src/main/java/com/google/ortools/constraintsolver/RoutingSearchParametersOrBuilder.java | 0.862352 | 0.444444 | RoutingSearchParametersOrBuilder.java | starcoder |
package com.linkedin.dagli.util.function;
import com.linkedin.dagli.util.named.Named;
import java.util.Objects;
/**
* Implements the negation of the result of a boolean function.
*
* This class is {@link java.io.Serializable} to allow its subclass (also named Serializable) to be serialized, but
* should not be r... | util-function/src/template/generated/com/linkedin/dagli/util/function/BooleanNegatedFunction4.java | 0.934924 | 0.468912 | BooleanNegatedFunction4.java | starcoder |
package org.jogamp.java3d.internal;
/**
* The FastVector object is a growable array of ints. It's much faster
* than the Java Vector class because it isn't synchronized. This class
* was created because it is needed in several places by graphics
* utilities.
*/
public class FastVector {
private int data[];
... | src/main/java/org/jogamp/java3d/internal/FastVector.java | 0.617974 | 0.457379 | FastVector.java | starcoder |
package eu.woolplatform.utils.geom;
/**
* This class defines a line segment. It consists of a start point and end
* point.
*
* @author <NAME> (RRD)
*/
public class LineSegment {
private Point start;
private Point end;
/**
* Constructs a new line segment.
*
* @param start the start point
* @param end t... | java/WoolUtils/src/main/java/eu/woolplatform/utils/geom/LineSegment.java | 0.934739 | 0.607343 | LineSegment.java | starcoder |
package org.broadinstitute.hellbender.tools.coveragemodel.linalg;
import org.apache.commons.math3.exception.DimensionMismatchException;
import org.broadinstitute.hellbender.utils.Utils;
import org.broadinstitute.hellbender.utils.param.ParamUtils;
import org.jtransforms.fft.DoubleFFT_1D;
import javax.annotation.Nonnul... | src/main/java/org/broadinstitute/hellbender/tools/coveragemodel/linalg/FourierLinearOperator.java | 0.927145 | 0.498169 | FourierLinearOperator.java | starcoder |
package org.whitehole.infra.types;
import java.io.IOException;
import java.io.InputStream;
import org.whitehole.infra.io.LargeByteBuffer;
public class LittleEndianReader {
public static ByteArray1 readByteArray1(LargeByteBuffer buffer, long offset) {
return new ByteArray1(buffer.get(offset + 0));
}
public sta... | src/main/java/org/whitehole/infra/types/LittleEndianReader.java | 0.727201 | 0.417628 | LittleEndianReader.java | starcoder |
package org.jitsi.impl.neomedia.codec.audio.silk;
import java.util.Arrays;
public class FindPredCoefsFLP {
static final /* synthetic */ boolean $assertionsDisabled = (!FindPredCoefsFLP.class.desiredAssertionStatus());
static int frame_cnt = 0;
static void SKP_Silk_find_pred_coefs_FLP(SKP_Silk_encoder_sta... | doc/libjitisi/sources/org/jitsi/impl/neomedia/codec/audio/silk/FindPredCoefsFLP.java | 0.639173 | 0.42656 | FindPredCoefsFLP.java | starcoder |
package me.wobblyyyy.pathfinder.trajectory;
import me.wobblyyyy.intra.ftc2.utils.math.Range;
import me.wobblyyyy.pathfinder.geometry.Point;
/**
* Instantiable class used in interpreting a segment based on percentage X
* or percentage Y values. Segments themselves are very lovely, but are based
* on raw coordinate ... | src/main/java/me/wobblyyyy/pathfinder/trajectory/SegmentInterpolator.java | 0.907574 | 0.535949 | SegmentInterpolator.java | starcoder |
package com.samrj.devil.graphics;
import com.samrj.devil.geo3d.Ellipsoid;
import com.samrj.devil.geo3d.Geometry;
import com.samrj.devil.geo3d.SweepResult;
import com.samrj.devil.math.Util;
import com.samrj.devil.math.Vec2;
import com.samrj.devil.math.Vec3;
/**
* Allows for input and control of 3D cameras, for third-... | src/com/samrj/devil/graphics/Camera3DController.java | 0.917843 | 0.44565 | Camera3DController.java | starcoder |
package com.opengamma.strata.measure.fxopt;
import java.util.Optional;
import org.joda.convert.FromString;
import org.joda.convert.ToString;
import com.google.common.base.CaseFormat;
import com.opengamma.strata.basics.CalculationTarget;
import com.opengamma.strata.calc.CalculationRules;
import com.opengamma.strata.c... | modules/measure/src/main/java/com/opengamma/strata/measure/fxopt/FxSingleBarrierOptionMethod.java | 0.85318 | 0.538498 | FxSingleBarrierOptionMethod.java | starcoder |
package com.avail.interpreter.levelTwo.operand;
import com.avail.interpreter.levelTwo.L2Instruction;
import com.avail.interpreter.levelTwo.L2OperandDispatcher;
import com.avail.interpreter.levelTwo.L2OperandType;
import com.avail.interpreter.levelTwo.operation.L2_JUMP;
import com.avail.interpreter.levelTwo.register.L2... | src/main/java/com/avail/interpreter/levelTwo/operand/L2PcOperand.java | 0.876859 | 0.498291 | L2PcOperand.java | starcoder |
package de.ma_vin.util.sample.content.mapper;
import de.ma_vin.util.layer.generator.annotations.mapper.BaseTransportMapper;
import de.ma_vin.util.sample.content.domain.DomainObjectFactory;
import de.ma_vin.util.sample.content.domain.IIdentifiable;
import de.ma_vin.util.sample.content.domain.Root;
import de.ma_vin.util... | layer-generator-sample/src/main/java/de/ma_vin/util/sample/content/mapper/CommonTransportMapper.java | 0.89317 | 0.700972 | CommonTransportMapper.java | starcoder |
package io.electra.core.model;
import io.electra.core.exception.MalformedDataException;
import java.nio.ByteBuffer;
/**
* @author <NAME> <<EMAIL>>
*/
public class DataBlock {
/**
* The size of one data block.
*/
public static final int DATA_BLOCK_SIZE = 128;
/**
* The size of one data block.
*/
... | core/src/main/java/io/electra/core/model/DataBlock.java | 0.843959 | 0.467028 | DataBlock.java | starcoder |
package com.gitlab.sszuev.tasks.sorting.external;
/**
* Created by @ssz on 19.09.2021.
*/
public class MergeAlgorithms {
/**
* Merges two sorted halves of array into a new array.
* Time complexity {@code O(n)}, memory complexity {@code O(n)}.
*
* @param array an {@code Array} of {@code ch... | algorithms/src/main/java/com/gitlab/sszuev/tasks/sorting/external/MergeAlgorithms.java | 0.928894 | 0.520618 | MergeAlgorithms.java | starcoder |
package uk.co.stuffusell.api.common.consignment;
import java.math.BigDecimal;
public class ConsignmentInventorySummaryDto {
private String classifier;
private boolean openStatus;
private int itemCount;
private int itemCountClosed;
private int consignmentQuantity;
private int receivedQuantity;
... | src/main/java/uk/co/stuffusell/api/common/consignment/ConsignmentInventorySummaryDto.java | 0.840226 | 0.482002 | ConsignmentInventorySummaryDto.java | starcoder |
package hashtable;
import java.util.*;
public class LC939MinimumAreaRectangle {
public int minAreaRect(int[][] points) {
Map<Integer, List<Integer>> datas = new TreeMap<>();
for (int[] point : points) {
datas.computeIfAbsent(point[0], x -> new ArrayList<>()).add(point[1]);
}
... | src/hashtable/LC939MinimumAreaRectangle.java | 0.80479 | 0.469703 | LC939MinimumAreaRectangle.java | starcoder |
package renderer.external;
import javafx.scene.Group;
import javafx.scene.control.Button;
import javafx.scene.control.ListView;
import javafx.scene.control.ScrollPane;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.paint.Color;
import javafx.scene.text.Font;
import javafx.sce... | src/main/java/com.yeet.renderer/src/renderer/external/Renderer.java | 0.881749 | 0.403596 | Renderer.java | starcoder |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.