conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "human", "value": "Use continue with a label" }, { "from": "gpt", "value": "// Use continue with a label.\nclass ContToLabel {\n\tpublic static void main(String args[]) {\n\t\nouterloop:\n\t\tfor(int i=1; i < 10; i++) {\n\t\t\tSystem.out.print(\"\\nOuter loop pass \" + i + \", Inner lo...
java
chosen
[ { "from": "human", "value": "Add a new test for DocumentSnapshotRepositoryMonitorManagerImpl\n" }, { "from": "gpt", "value": "// Copyright 2009 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the Licens...
java
chosen
[ { "from": "human", "value": "Add unit test for ZipcodeReader\n" }, { "from": "gpt", "value": "package com.github.rnowling.bps.datagenerator.datareaders;\n\nimport static org.junit.Assert.assertNotNull;\nimport static org.junit.Assert.assertTrue;\n\nimport java.util.List;\n\nimport org.junit.Test...
java
chosen
[ { "from": "system", "value": "Disable the action on the debug toolbar if there is no stream call\n" }, { "from": "human", "value": "package com.intellij.debugger.streams.action;\n\nimport com.intellij.openapi.actionSystem.AnAction;\nimport com.intellij.openapi.actionSystem.AnActionEvent;\nimport...
java
chosen
[ { "from": "human", "value": "Add Kinect buffered data class\n" }, { "from": "gpt", "value": "package com.haxademic.core.hardware.kinect;\n\nimport java.util.ArrayList;\n\nimport com.haxademic.core.data.FloatBuffer;\n\npublic class KinectBufferedData {\n\t\n\tprotected float _pixelSize;\n\tprotec...
java
chosen
[ { "from": "human", "value": "Add statement to problem 36\n" }, { "from": "gpt", "value": "/*\n * Copyright (C) 2014 Pedro Vicente Gómez Sánchez.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You ...
java
chosen
[ { "from": "human", "value": "Add common provider with some basic utility features\n" }, { "from": "gpt", "value": "package info.u_team.u_team_core.data;\n\nimport java.io.*;\nimport java.nio.file.*;\nimport java.util.Objects;\n\nimport org.apache.logging.log4j.*;\n\nimport com.google.gson.*;\nim...
java
chosen
[ { "from": "human", "value": "Test exposing MultiSplitPane model reset issue.\n\n\ngit-svn-id: 9c6ef37dfd7eaa5a3748af7ba0f8d9e7b67c2a4c@2234 1312f61e-266d-0410-97fa-c3b71232c9ac\n" }, { "from": "gpt", "value": "package org.jdesktop.swingx;\nimport java.awt.BorderLayout;\nimport java.awt.Color;\ni...
java
chosen
[ { "from": "human", "value": "Check if a tree is BST or not using brute force.O(Nsquared)\n" }, { "from": "gpt", "value": "package com.sunny.grokkingalgorithms.fasttrack.treesandgraphs;\n\nimport com.sunny.grokkingalgorithms.ctci.c4.util.BinaryTreeNode;\nimport com.sunny.grokkingalgorithms.ctci.c...
java
chosen
[ { "from": "human", "value": "Add a simple test for AsyncTabCreationParamsManager\n\nBUG=508333\n\nReview URL: https://codereview.chromium.org/1234413003\n\nCr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#340132}\n" }, { "from": "gpt", "value": "// Copyright 2015 The Chromium Autho...
java
chosen
[ { "from": "human", "value": "Add a serviceContext for the modifyDn operation\n\ngit-svn-id: 90776817adfbd895fc5cfa90f675377e0a62e745@527483 13f79535-47bb-0310-9956-ffa450edef68\n" }, { "from": "gpt", "value": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contri...
java
chosen
[ { "from": "human", "value": "Test enums annotated with Hibernate Validator annotations\n\nFails with the current version of Hibernate Validator.\n" }, { "from": "gpt", "value": "package io.quarkus.it.hibernate.validator.enums;\n\nimport javax.validation.constraints.NotNull;\n\n/**\n * Simply add...
java
chosen
[ { "from": "human", "value": "Add tests for top sort.\n" }, { "from": "gpt", "value": "package com.stephenramthun.algorithms.graph;\n\nimport static org.junit.jupiter.api.Assertions.assertNull;\nimport static org.junit.jupiter.api.Assertions.assertTrue;\nimport static org.junit.jupiter.api.Assert...
java
chosen
[ { "from": "human", "value": "Add new field for passwords.\n\nSigned-off-by: Michael Handler <331a76cd0f162b0218893a3dfa4df5a8bf659d1e@fullstop.at>\n" }, { "from": "gpt", "value": "/**\n\n Copyright 2010 OpenEngSB Division, Vienna University of Technology\n\n Licensed under the Apache License...
java
chosen
[ { "from": "human", "value": "Test that hardcoded lists of Hibernate ORM annotations stay up-to-date\n\nSigned-off-by: Yoann Rodière <be2a24d2f52a7ba2aca48263378b2614d5b68cd6@hibernate.org>\n" }, { "from": "gpt", "value": "package io.quarkus.hibernate.orm;\n\nimport static org.assertj.core.api.As...
java
chosen
[ { "from": "human", "value": "Add a test for the UserGroupPermissionEvaluator\n" }, { "from": "gpt", "value": "/**\n *\n */\npackage de.terrestris.shogun2.security.access.entity;\n\nimport static org.hamcrest.CoreMatchers.equalTo;\nimport static org.junit.Assert.assertThat;\n\nimport java.util.Ar...
java
chosen
[ { "from": "human", "value": "Add exception mapper test controller" }, { "from": "gpt", "value": "package com.coding4people.mosquitoreport.api.exceptionmappers;\n\nimport javax.validation.Valid;\nimport javax.validation.constraints.NotNull;\nimport javax.ws.rs.Consumes;\nimport javax.ws.rs.POST;\...
java
chosen
[ { "from": "human", "value": "Add sample for displaying vCenter Server info.\n" }, { "from": "gpt", "value": "package com.vmware.vim25.mo.samples;\n\nimport com.vmware.vim25.AboutInfo;\nimport com.vmware.vim25.mo.ServiceInstance;\n\npublic class VCenterServerInfo {\n\n public static void main(S...
java
chosen
[ { "from": "human", "value": "Add spec for failing @Rule\n" }, { "from": "gpt", "value": "package com.github.havarunner.rules;\n\nimport com.github.havarunner.HavaRunner;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.rules.TestRule;\nimport org.junit.runner.Description;\nimpor...
java
chosen
[ { "from": "human", "value": "Split PST File into multiple PST files example\n" }, { "from": "gpt", "value": "/*\n * Copyright 2001-2015 Aspose Pty Ltd. All Rights Reserved.\n *\n * This file is part of Aspose.Email. The source code in this file\n * is only intended as a supplement to the documen...
java
chosen
[ { "from": "human", "value": "Create abstract config output converter.\n" }, { "from": "gpt", "value": "package com.github.aureliano.evtbridge.core.config;\n\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Properties;\n\nimport com.github.aureliano.evtbridge.common.helper.Reflect...
java
chosen
[ { "from": "human", "value": "Add interrupt bundling process exception" }, { "from": "gpt", "value": "/**\n * Copyright 2016 Ibrahim Chaehoi\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file\n * except in compliance with the License. You may obta...
java
chosen
[ { "from": "human", "value": "Add interface for modifiable fluid handlers with setFluidInTank method" }, { "from": "gpt", "value": "package info.u_team.u_team_core.api.fluid;\n\nimport net.minecraftforge.fluids.FluidStack;\nimport net.minecraftforge.fluids.capability.IFluidHandler;\n\npublic inte...
java
chosen
[ { "from": "human", "value": "Add tests for DataSourcePoolMetricsAutoConfiguration ConditionalOnBean\n" }, { "from": "gpt", "value": "/**\n * Copyright 2017 Pivotal Software, Inc.\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in...
java
chosen
[ { "from": "human", "value": "Add Merge K Sorted Lists\n" }, { "from": "gpt", "value": "package problems;\n\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.PriorityQueue;\n\npublic class MergeKSortedLists {\n\n public class ListNode {\n int val;\n ListNode ...
java
chosen
[ { "from": "human", "value": "[xml] Add missing cityMapper (was being picked up elsewhere on original classpath)\n" }, { "from": "gpt", "value": "/*\n * Copyright 2015-2021 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you m...
java
chosen
[ { "from": "human", "value": "Add JSON and XML printers\n" }, { "from": "gpt", "value": "package org.judal.examples.java.jdbc;\r\n\r\nimport org.junit.Test;\r\n\r\nimport java.text.SimpleDateFormat;\r\nimport java.util.Date;\r\nimport java.util.HashMap;\r\nimport java.util.Map;\r\n\r\nimport org....
java
chosen
[ { "from": "human", "value": "Verify that the spliterator excepts on various invalid characters with a useful message, and the exception too" }, { "from": "gpt", "value": "package net.stickycode.stile.version.component;\n\nimport net.stickycode.exception.PermanentException;\n\n@SuppressWarnings(\...
java
chosen
[ { "from": "human", "value": "Add basic interface to define session\n" }, { "from": "gpt", "value": "package org.realityforge.ssf;\n\nimport javax.annotation.Nonnull;\n\n/**\n * A basic interface defining a session.\n */\npublic interface SessionInfo\n{\n /**\n * @return an opaque ID represent...
java
chosen
[ { "from": "human", "value": "Add test loot tables provider" }, { "from": "gpt", "value": "package info.u_team.u_team_test.data.provider;\n\nimport java.util.function.BiConsumer;\n\nimport info.u_team.u_team_core.data.*;\nimport net.minecraft.util.ResourceLocation;\nimport net.minecraft.world.sto...
java
chosen
[ { "from": "human", "value": "Add a delegating JSF NavigationHandler implementation\n\n\ngit-svn-id: b619a0c99665f88f1afe72824344cefe9a1c8c90@9083 fd5a2b45-1f63-4059-99e9-3c7cb7fd75c8\n" }, { "from": "gpt", "value": "/*\n * Copyright 2006 the original author or authors.\n * \n * Licensed under th...
java
chosen
[ { "from": "human", "value": "Patch for HARMONY-4838 \"[classlib][swing] hang up when call \nJDialog.setVisible\"\n\nsvn path=/harmony/; revision=585981\n" }, { "from": "gpt", "value": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements....
java
chosen
[ { "from": "human", "value": "Add vertex class for dfs\n" }, { "from": "gpt", "value": "package dfs;\n\n/*\n\tThis class defines a Vertex for Depth First Searcg Algorithm\n*/\n\nclass Vertex{\n\n\tprivate int name = -1;\t\t\t\t// Vertex name\t\t\t\t\t\n\tprivate int d = -1; \t\t\t\t\t// Discovery...
java
chosen
[ { "from": "human", "value": "Add small testcase for JVM internal caching\nBy default, from -128 to 127 for Integer\n" }, { "from": "gpt", "value": "import org.junit.Test;\n\nimport static org.junit.Assert.assertTrue;\n\npublic class JvmCaching {\n\n @Test\n public void testCache() {\n\n ass...
java
chosen
[ { "from": "human", "value": "Add a test file to test the CSVLoder class\n" }, { "from": "gpt", "value": "package org.voltdb.utils;\n\nimport org.voltdb.ServerThread;\nimport org.voltdb.VoltDB;\nimport org.voltdb.VoltTable;\nimport org.voltdb.VoltDB.Configuration;\nimport org.voltdb.client.Client...
java
chosen
[ { "from": "human", "value": "Put the problem 24 skeleton\n" }, { "from": "gpt", "value": "package leetcode;\n\n/**\n * https://oj.leetcode.com/problems/swap-nodes-in-pairs/\n */\npublic class Problem24 {\n static class ListNode {\n int val;\n ListNode next;\n\n ListNode(i...
java
chosen
[ { "from": "human", "value": "Create package info class for \"com.arcticicestudio.icecore.hashids\"\n" }, { "from": "gpt", "value": "/*\n+++++++++++++++++++++++++++++++++++++++++++\ntitle Package Info +\nproject icecore-hashids +\nfile package-info.ja...
java
chosen
[ { "from": "human", "value": "Refactor of test class.. no need for underscore in name" }, { "from": "gpt", "value": "package it.uniroma3.dia.alfredmpi.xpath;\r\n\r\nimport static org.junit.Assert.*;\r\n\r\nimport model.Page;\r\nimport org.junit.Before;\r\nimport org.junit.Test;\r\n\r\npublic clas...
java
chosen
[ { "from": "human", "value": "Add tests for the path of the network\n\nAdd a new test that verifies the Info objects is deserialised properly\nfrom the docker info json object and contains the networks.\n" }, { "from": "gpt", "value": "package com.spotify.docker.client.messages;\n\nimport com.fas...
java
chosen
[ { "from": "human", "value": "Add basic tests on metabuild executor\n\ngit-svn-id: 35a9a2fae79612fe376d9daba97ee135800c982b@1528961 13f79535-47bb-0310-9956-ffa450edef68\n" }, { "from": "gpt", "value": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor lic...
java
chosen
[ { "from": "human", "value": "XRENDERING-356: Introduce helper to deletgate WikiPrinter calls to a Writer\n" }, { "from": "gpt", "value": "/*\n * See the NOTICE file distributed with this work for additional\n * information regarding copyright ownership.\n *\n * This is free software; you can red...
java
chosen
[ { "from": "human", "value": "Add support for Almquist shell in masking\n" }, { "from": "gpt", "value": "/*\n * The MIT License\n *\n * Copyright (c) 2019 CloudBees, Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated docum...
java
chosen
[ { "from": "human", "value": "Add a location type backed by a file on disk\n" }, { "from": "gpt", "value": "/*\n * #%L\n * SciJava Common shared library for SciJava software.\n * %%\n * Copyright (C) 2009 - 2015 Board of Regents of the University of\n * Wisconsin-Madison, Broad Institute of MIT a...
java
chosen
[ { "from": "human", "value": "Create a pojo class for easier transfer of data between the server and gwt\n" }, { "from": "gpt", "value": "package net.devrieze.chatterbox.shared;\n\nimport java.io.Serializable;\nimport java.security.Principal;\nimport java.util.Calendar;\nimport java.util.Gregoria...
java
chosen
[ { "from": "human", "value": "Add partially implemented parser class\n" }, { "from": "gpt", "value": "package com.example.podcastplayer;\n\nimport java.io.IOException;\nimport java.io.StringReader;\n\nimport org.xmlpull.v1.XmlPullParser;\nimport org.xmlpull.v1.XmlPullParserException;\nimport org....
java
chosen
[ { "from": "human", "value": "Add driver with main method to run a Spinner.\n" }, { "from": "gpt", "value": "package net.cbojar.spinner;\n\nimport net.cbojar.spinner.spinners.*;\n\npublic final class Main\n{\n\tpublic static void main(final String[] args) {\n\t\tfinal SpinnerFactory spinFactory =...
java
chosen
[ { "from": "human", "value": "Put some common function into a Utils class for better reuse\n" }, { "from": "gpt", "value": "package cc.mrlda;\n\nimport java.util.HashMap;\nimport java.util.HashSet;\nimport java.util.Iterator;\nimport java.util.Map;\nimport java.util.Set;\n\nimport org.apache.hado...
java
chosen
[ { "from": "human", "value": "Create a skeleton for problem 113\n" }, { "from": "gpt", "value": "package leetcode;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\npublic class Problem113 {\n public static class TreeNode {\n int val;\n TreeNode left;\n TreeNode ri...
java
chosen
[ { "from": "human", "value": "Create skeleton for problem 307\n" }, { "from": "gpt", "value": "package leetcode;\n\n/**\n * https://leetcode.com/problems/range-sum-query-mutable/\n */\npublic class Problem307 {\n public static class NumArray {\n\n public NumArray(int[] nums) {\n\n ...
java
chosen
[ { "from": "human", "value": "HTTPCLIENT-1191: PATCH HTTP method\nContributed by Alin Vasile <alinachegalati at yahoo dot com>\n\ngit-svn-id: 897293da6115b9493049ecf64199cf2f9a0ac287@1339134 13f79535-47bb-0310-9956-ffa450edef68\n" }, { "from": "gpt", "value": "/*\n * =============================...
java
chosen
[ { "from": "system", "value": "Add default method for compatibility\n" }, { "from": "human", "value": "package com.jetbrains.python.debugger;\n\nimport com.intellij.xdebugger.XSourcePosition;\nimport org.jetbrains.annotations.NotNull;\nimport org.jetbrains.annotations.Nullable;\n\n\npublic interf...
java
chosen
[ { "from": "human", "value": "Add some tests to problem 22\n" }, { "from": "gpt", "value": "/*\n * Copyright (C) 2014 Pedro Vicente Gómez Sánchez.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You...
java
chosen
[ { "from": "human", "value": "Add APITimerCounter which only counts the first call within a thread to an API\n" }, { "from": "gpt", "value": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this...
java
chosen
[ { "from": "human", "value": "Add skeleton test cases for hash map.\n" }, { "from": "gpt", "value": "import org.junit.*;\n\npublic class HashMapTest {\n\n HashMap hm;\n\n @Before\n public void init() {\n hm = new HashMap(7);\n }\n\n @Test\n public void testInsertSingleKey() {\n\n }\n\n ...
java
chosen
[ { "from": "human", "value": "Configure static resource handler in springboot" }, { "from": "gpt", "value": "package com.anderson.hummingbird.server;\n\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;\...
java
chosen
[ { "from": "human", "value": "Refactor the code so we can set our own message for parser error.\n" }, { "from": "gpt", "value": "/*******************************************************************************\n * Copyright (c) 2013, Salesforce.com, Inc.\n * All rights reserved.\n * \n * Redistri...
java
chosen
[ { "from": "human", "value": "Add tests for email validation\n\n" }, { "from": "gpt", "value": "package at.ac.tuwien.inso.validator_tests;\n\n\nimport org.junit.Test;\n\nimport at.ac.tuwien.inso.exception.ValidationException;\nimport at.ac.tuwien.inso.service.validator.UisUserValidator;\n\n\npubl...
java
chosen
[ { "from": "human", "value": "Solve Median w/ two heaps\n" }, { "from": "gpt", "value": "import java.io.*;\nimport java.util.*;\nimport java.text.*;\nimport java.math.*;\nimport java.util.regex.*;\n\nclass MedianHeap {\n\n public PriorityQueue<Integer> minHeap;\n public PriorityQueue<Intege...
java
chosen
[ { "from": "human", "value": "Make sure we flag this at the right location\n\n\ngit-svn-id: e7d6bde23f017c9ff4efd468d79d66def666766b@5965 eae3c2d3-9b19-0410-a86e-396b6ccb6ab3\n" }, { "from": "gpt", "value": "package npe;\n\npublic class InSwitchStatement {\n\n\tint f(int x) {\n\t\tString s = null...
java
chosen
[ { "from": "human", "value": "Write solution to question 1 in java\n" }, { "from": "gpt", "value": "public class Solution {\n public static int firstOccurrence(int[] nums, int k) {\n int first = 0;\n int last = nums.length - 1;\n while (first < last - 1) {\n int...
java
chosen
[ { "from": "system", "value": "Add concepts to parser-spi's requires\n\nThis is another tiny change for Eclipse's sake.\n\nChange-Id: I2d50dedf232d63456f3574bc1f025f92d558a736\nSigned-off-by: Robert Varga <91ae5aa8c7a9f7e57b701db766e23e544aaa6ae9@pantheon.tech>\n" }, { "from": "human", "value": "...
java
chosen
[ { "from": "human", "value": "Add rudimentary tests for Auth0ServletCallback.init(ServletConfig):\n- failOnMissingInitParameters: passes\n- failOnMissingServletContextParameters: fails\n" }, { "from": "gpt", "value": "package com.auth0;\n\nimport static java.util.Collections.emptyEnumeration;\nim...
java
chosen
[ { "from": "human", "value": "Add a test for form validation\n" }, { "from": "gpt", "value": "import org.junit.Assert;\nimport org.junit.Test;\n\nimport static play.data.Form.form;\n\nimport java.util.List;\n\nimport play.data.Form;\nimport play.data.validation.Constraints.Email;\nimport play.dat...
java
chosen
[ { "from": "human", "value": "Create Adapter class and add boilerplate code\n" }, { "from": "gpt", "value": "package pl.komunikator.komunikator;\n\nimport android.support.v7.widget.RecyclerView;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.ImageView;\nimport a...
java
chosen
[ { "from": "human", "value": "Test for multiple thread executor" }, { "from": "gpt", "value": "package tests.eu.qualimaster.common;\r\n\r\nimport java.io.IOException;\r\nimport java.net.ServerSocket;\r\nimport java.net.Socket;\r\nimport java.util.ArrayList;\r\nimport java.util.HashMap;\r\nimport ...
java
chosen
[ { "from": "human", "value": "Add skeleton for problem 289\n" }, { "from": "gpt", "value": "package leetcode;\n\n/**\n * https://leetcode.com/problems/game-of-life/\n */\npublic class Problem289 {\n public void gameOfLife(int[][] board) {\n // TODO\n }\n\n public static void main(...
java
chosen
[ { "from": "human", "value": "Add a URL shortening module" }, { "from": "gpt", "value": "package heufybot.modules;\n\nimport heufybot.utils.URLUtils;\n\nimport java.util.List;\n\npublic class Shorten extends Module\n{\n\tpublic Shorten()\n\t{\n\t\tthis.authType = Module.AuthType.Anyone;\n\t\tthis...
java
chosen
[ { "from": "human", "value": "Add new class that helpes pretty print 2D arrays.\n" }, { "from": "gpt", "value": "package org.kedos.print;\n\nimport java.util.Arrays;\n\n/**\n * Created by shaked on 09/11/2015.\n */\npublic class PrintUtils {\n\n /**\n * Prints the given 2D array.\n *\n...
java
chosen
[ { "from": "human", "value": "Solve No.11718 from Baekjoon Online Judge\n" }, { "from": "gpt", "value": "/*\n * Copyright 2017 haeun kim\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtai...
java
chosen
[ { "from": "human", "value": "Add a benchmark for Levenshtein automaton construction.\n" }, { "from": "gpt", "value": "// Copyright 2013 Daniel de Kok\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n//...
java
chosen
[ { "from": "human", "value": "Add alert dialog to handle errors\n" }, { "from": "gpt", "value": "package com.jose.feelagaininecuador.alert_dialogs;\n\nimport android.app.AlertDialog;\nimport android.app.Dialog;\nimport android.app.DialogFragment;\nimport android.content.Context;\nimport android.o...
java
chosen
[ { "from": "human", "value": "Add temp voice channel test\n" }, { "from": "gpt", "value": "package com.nincraft.ninbot.components.channel;\n\nimport com.nincraft.ninbot.NinbotTest;\nimport com.nincraft.ninbot.components.common.Emojis;\nimport com.nincraft.ninbot.components.config.component.Compon...
java
chosen
[ { "from": "human", "value": "Add java solution for 134. Gas Station\n\n134. Gas Station: https://leetcode.com/problems/gas-station/" }, { "from": "gpt", "value": "package leetcode.gas_station;\n\n\npublic class Solution {\n\tpublic int canCompleteCircuit(int[] gas, int[] cost) {\n\t\tif (gas.len...
java
chosen
[ { "from": "human", "value": "Add Repair Management Repair Mapper\n" }, { "from": "gpt", "value": "/*\n * This program was produced for the U.S. Agency for International Development. It was prepared by the USAID | DELIVER PROJECT, Task Order 4. It is part of a project which utilizes code original...
java
chosen
[ { "from": "human", "value": "Add basic location biome command" }, { "from": "gpt", "value": "package info.u_team.u_team_core.intern.command.uteamcore;\n\nimport java.util.*;\n\nimport com.mojang.brigadier.builder.ArgumentBuilder;\n\nimport net.minecraft.command.*;\nimport net.minecraft.command.a...
java
chosen
[ { "from": "human", "value": "Add abstract Impl for EditEntityPaneModel\n\nOPEN - task 54: Create Category CRUD packages \nhttp://github.com/DevOpsDistilled/OpERP/issues/issue/54" }, { "from": "gpt", "value": "package devopsdistilled.operp.client.abstracts;\n\nimport devopsdistilled.operp.server....
java
chosen
[ { "from": "human", "value": "Test that speculative executions use the same timestamp (JAVA-724).\n\nThe bug was fixed by JAVA-726.\n" }, { "from": "gpt", "value": "/*\n * Copyright (C) 2012-2015 DataStax Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * ...
java
chosen
[ { "from": "human", "value": "[ONOS-3248] Add the junit test code of AllowedAddressPair\n\nChange-Id: I8d4086353f37febd15de5323446e22dd57b4e437\n" }, { "from": "gpt", "value": "/*\n * Copyright 2015 Open Networking Laboratory\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\...
java
chosen
[ { "from": "human", "value": "Add java solution for 48. Rotate Image\n\n48. Rotate Image: https://leetcode.com/problems/rotate-image/" }, { "from": "gpt", "value": "package leetcode.rotate_image;\n\npublic class Solution {\n public void rotate(int[][] matrix) {\n if(matrix == null) retu...
java
chosen
[ { "from": "human", "value": "Add a test for ParameterizedRobolectricTestRunner's @Parameter\n\nPiperOrigin-RevId: 197394946\n" }, { "from": "gpt", "value": "package org.robolectric;\n\nimport static com.google.common.truth.Truth.assertThat;\n\nimport java.util.Arrays;\nimport java.util.Collectio...
java
chosen
[ { "from": "human", "value": "Add basic tests for hash values" }, { "from": "gpt", "value": "package magic.lang;\n\nimport static org.junit.Assert.*;\n\nimport org.junit.Test;\n\npublic class TestTools {\n\n\t@Test public void testHashCode() {\n\t\tassertEquals(0, Tools.hash(null));\n\t}\n}\n" ...
java
chosen
[ { "from": "human", "value": "Solve No.2941 from Baekjoon Online Judge\n" }, { "from": "gpt", "value": "/*\n * Copyright 2017 haeun kim\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain...
java
chosen
[ { "from": "human", "value": "Rename from TIFFFrame and moved to cafe.image.core\n" }, { "from": "gpt", "value": "/**\n * Copyright (c) 2014 by Wen Yu.\n * All rights reserved. This program and the accompanying materials\n * are made available under the terms of the Eclipse Public License v1.0\n ...
java
chosen
[ { "from": "human", "value": "Add problem 1 to unit 2\n" }, { "from": "gpt", "value": "import java.util.Scanner;\n\n/**\n * This program computes the maximum in an integer array inputted by the user\n **/\npublic class MaxArray {\n public static void main(String[] args) {\n System.out.p...
java
chosen
[ { "from": "human", "value": "Add a test for injecting extensions.\n\nFixes #6\n" }, { "from": "gpt", "value": "package name.falgout.jeffrey.testing.junit.guice;\n\nimport static com.google.common.truth.Truth.assertThat;\nimport static org.junit.jupiter.api.Assertions.fail;\n\nimport com.google.i...
java
chosen
[ { "from": "human", "value": "Test getChildren of the CategoryClient\n\n\ngit-svn-id: afcf11d89342f630bd950d18a70234a9e277d909@97575 523d945c-050c-4681-91ec-863ad3bb968a\n" }, { "from": "gpt", "value": "package alma.alarmsystem.clients.test;\n\nimport cern.laser.client.data.Alarm;\nimport cern.la...
java
chosen
[ { "from": "human", "value": "Add a test for Olivier Norberg EMG estimator." }, { "from": "gpt", "value": "/*\n * This file is part of ELKI:\n * Environment for Developing KDD-Applications Supported by Index-Structures\n *\n * Copyright (C) 2017\n * ELKI Development Team\n *\n * This program is f...
java
chosen
[ { "from": "human", "value": "Simplify Spike Maul target definitions and move to API.\n" }, { "from": "gpt", "value": "/*------------------------------------------------------------------------------\n Copyright (c) CovertJaguar, 2011-2016\n\n This work (the API) is licensed under the \"MIT\" Lic...
java
chosen
[ { "from": "human", "value": "Create a skeleton for problem 328\n" }, { "from": "gpt", "value": "package leetcode;\n\n/**\n * https://leetcode.com/problems/odd-even-linked-list/\n */\npublic class Problem328 {\n public class ListNode {\n int val;\n ListNode next;\n\n ListN...
java
chosen
[ { "from": "human", "value": "Create : 657 Judge Route Circle\n" }, { "from": "gpt", "value": "public class Solution {\n\n public boolean judgeCircle(String moves) {\n\n int x = 0;\n int y = 0;\n\n for (int i = 0; i < moves.length(); i++) {\n\n switch (moves.cha...
java
chosen
[ { "from": "human", "value": "Add data validator for user class\n\n" }, { "from": "gpt", "value": "package stopheracleum.validator;\n\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Component;\nimport org.springframework.validation.Errors;\ni...
java
chosen
[ { "from": "human", "value": "Create a skeleton for problem 263\n" }, { "from": "gpt", "value": "package leetcode;\n\n/**\n * https://leetcode.com/problems/ugly-number/\n */\npublic class Problem263 {\n public boolean isUgly(int num) {\n return false;\n }\n \n public static voi...
java
chosen
[ { "from": "human", "value": "Add utils for DataInput & DataOutput\n\nMostly wrappers right now.\n" }, { "from": "gpt", "value": "package net.darkmist.alib.io;\n\nimport java.io.DataInput;\nimport java.io.DataOutput;\nimport java.io.InputStream;\nimport java.io.InputStreamReader;\nimport java.io....
java
chosen
[ { "from": "human", "value": "Add CUDA memory manage functions\n" }, { "from": "gpt", "value": "/*\n * To change this license header, choose License Headers in Project Properties.\n * To change this template file, choose Tools | Templates\n * and open the template in the editor.\n */\npackage gvi...
java
chosen
[ { "from": "human", "value": "Add default implementation of Shear interface.\n" }, { "from": "gpt", "value": "package net.imagej.ops.views;\n\nimport net.imagej.ops.view.ViewOps;\nimport net.imagej.ops.view.ViewOps.Shear;\nimport net.imglib2.RandomAccessible;\nimport net.imglib2.view.TransformVie...
java
chosen
[ { "from": "human", "value": "Add java solution for 9. Palindrome Number\n\n9. Palindrome Number: https://leetcode.com/problems/palindrome-number/" }, { "from": "gpt", "value": "package leetcode.palindrome_number;\n\npublic class Solution {\n public boolean isPalindrome(int x) {\n \tif(x < ...
java
chosen
[ { "from": "human", "value": "Add JUnite test case stub\n" }, { "from": "gpt", "value": "package lb2xp;\n\nimport static org.junit.Assert.fail;\n\nimport org.junit.Test;\n\npublic class TestMBC\n{\n @Test\n public void testExpand()\n {\n fail( \"Not yet implemented\" );\n }\n}\...
java
chosen
[ { "from": "human", "value": "Put both test cases for use case 1 in here and changed the name so that it *might* potentially compile\n" }, { "from": "gpt", "value": "/* Covers test cases for use cases:\n * 1\n * \n * http://stackoverflow.com/questions/10845937/how-to-do-junit-testing-in-android\n...
java
chosen
[ { "from": "human", "value": "Bring code coverage to 100%/100% line/branch.\n\ngit-svn-id: cde5a1597f50f50feab6f72941f6b219c34291a1@798436 13f79535-47bb-0310-9956-ffa450edef68\n" }, { "from": "gpt", "value": "/*\r\n * Licensed to the Apache Software Foundation (ASF) under one or more\r\n * contri...
java
chosen
[ { "from": "human", "value": "Add solution for Game of Life\n\nGame of Life: https://leetcode.com/problems/game-of-life/\n" }, { "from": "gpt", "value": "package leetcode.game_of_life;\n\npublic class Solution {\n public void gameOfLife(int[][] board) {\n if(board == null || board.lengt...
java
chosen