conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "human", "value": "Check if one string is rotation of the other" }, { "from": "gpt", "value": "import java.io.*;\nimport java.util.*;\n\npublic class Rotation\n{\n\tpublic static void main(String[] args)\n\t{\n\t\tScanner sc=new Scanner(System.in);\n\t\tSystem.out.println(\"Enter 1st s...
java
chosen
[ { "from": "human", "value": "Add debugger class to print things out to console" }, { "from": "gpt", "value": "package util;\n\nimport java.util.Map;\nimport java.util.Set;\n\nimport org.joda.time.DateTime;\n\nimport schedulable.Activity;\nimport schedulable.Schedulable;\nimport schedulable.Trans...
java
chosen
[ { "from": "system", "value": "Set locale for the content of all API result\n" }, { "from": "human", "value": "package com.vmware.vim25.mo.samples;\n\nimport java.net.MalformedURLException;\nimport java.net.URL;\nimport java.rmi.RemoteException;\n\nimport com.vmware.vim25.mo.ServiceInstance;\n\np...
java
chosen
[ { "from": "human", "value": "Introduce version getter and setter program\n" }, { "from": "gpt", "value": "/*\n * Bach - Java Shell Builder\n * Copyright (C) 2019 Christian Stein\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in comp...
java
chosen
[ { "from": "human", "value": "Add a KalmanFilter for Java that takes input parameter\n" }, { "from": "gpt", "value": "package com.example.warner;\n\n/**\n * Simple implementation of the Kalman Filter for 1D data.\n * Originally written in JavaScript by Wouter Bulten\n *\n * Now rewritten into Jav...
java
chosen
[ { "from": "human", "value": "Test to check dna tables in non core, core schema dbs (eg. est and estgene)\nare empty (should be using core db as reference).\n" }, { "from": "gpt", "value": "/*\n Copyright (C) 2004 EBI, GRL\n \n This library is free software; you can redistribute it and/or\n modif...
java
chosen
[ { "from": "human", "value": "Write two functions to help test the code.\n" }, { "from": "gpt", "value": "package org.nwapw.abacus.tests;\n\nimport org.junit.Assert;\nimport org.junit.BeforeClass;\nimport org.nwapw.abacus.Abacus;\nimport org.nwapw.abacus.number.NumberInterface;\nimport org.nwapw....
java
chosen
[ { "from": "human", "value": "Add Encoding JSON in Java Example\n" }, { "from": "gpt", "value": "/**\n * @file JSONEncodeDemo.java\n * @author Valery Samovich\n * @version 1.0.0\n * @date 11/19/2014\n * \n * Following example to encode JSON Object using Java JSONObject with is \n * subclass of ja...
java
chosen
[ { "from": "human", "value": "Add example test to show how it's done\n\nI added a lot more comments than necessary, to explain what is going on.\n\nChange-Id: I20ab65e93fb69f54185b6c479119f01977b202be\n" }, { "from": "gpt", "value": "package se.kth.csc.controller;\n\nimport org.junit.Before;\nimp...
java
chosen
[ { "from": "human", "value": "Create Test for Pair Class\n" }, { "from": "gpt", "value": "package Pair;\n\nimport org.junit.After;\nimport org.junit.Before;\nimport org.junit.Test;\n\nimport static org.junit.Assert.*;\n\npublic class PairTest {\n\n Pair pair;\n\n @Before\n public void se...
java
chosen
[ { "from": "human", "value": "Add solution for Ransom note problem.\n" }, { "from": "gpt", "value": "import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.HashMap;\nimport java.util.Map;\n\n// https://www.hackerrank.com/challenges/ctci-ra...
java
chosen
[ { "from": "human", "value": "Add code for Twist in the Tale 2.3\n- Commented out bad code from 2.2 so that code can run.\n" }, { "from": "gpt", "value": "/**\n * Twist in the Tale 2.3 from the OCA Java SE 7 book by Mala Gupta (Manning Publications)\n * Created by Josef on 12/17/13.\n */\npublic ...
java
chosen
[ { "from": "human", "value": "Add helper class for reading CSV files\n" }, { "from": "gpt", "value": "package age;\n\nimport java.io.IOException;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.util.ArrayList;\nimport java.util.List;\n\npublic class CSVReader {\n\n\tpublic s...
java
chosen
[ { "from": "human", "value": "Test class for WsResource class\n" }, { "from": "gpt", "value": "package com.trit.security.utils.ws;\n\nimport org.junit.Test;\n\npublic class WsResourceTest {\n\n @Test(expected = IllegalArgumentException.class)\n public void testNullResource() {\n new ...
java
chosen
[ { "from": "human", "value": "Add code for Twist in the Tale 2.4\n" }, { "from": "gpt", "value": "/**\n * Created by Josef on 12/20/13.\n */\npublic class TwistInTheTale2_4 {\n public static void main (String[] args) {\n int a = 10;\n int b = 20;\n int c = 40;\n\n// ...
java
chosen
[ { "from": "human", "value": "Add test to show off the features of this framework." }, { "from": "gpt", "value": "/**\n * Copyright (c) 2011, Jilles van Gurp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation file...
java
chosen
[ { "from": "human", "value": "Add shorthand access for default package\n" }, { "from": "gpt", "value": "import org.svetovid.io.StandardSvetovidErrorWriter;\r\nimport org.svetovid.io.StandardSvetovidReader;\r\nimport org.svetovid.io.StandardSvetovidWriter;\r\nimport org.svetovid.io.SvetovidReader;...
java
chosen
[ { "from": "human", "value": "Add managing class for tick mark generation\n" }, { "from": "gpt", "value": "\npackage galileo.graph;\n\nimport galileo.dataset.feature.Feature;\n\nimport java.util.NavigableSet;\nimport java.util.TreeSet;\n\n/**\n * Represents the buckets described by \"Tick Marks\"...
java
chosen
[ { "from": "human", "value": "Add java solution for 50. Pow(x, n)\n\n50. Pow(x, n): https://leetcode.com/problems/powx-n/" }, { "from": "gpt", "value": "package leetcode.powx_n;\n\npublic class Solution {\n public double pow(double x, long n) {\n \tif(x == 0){\n \t\tif(n == 0) return Dou...
java
chosen
[ { "from": "human", "value": "Add convenience method to safely autocast Tile Entities\n" }, { "from": "gpt", "value": "package org.cyclops.cyclopscore.helper;\n\nimport net.minecraft.tileentity.TileEntity;\nimport net.minecraft.util.BlockPos;\nimport net.minecraft.world.IBlockAccess;\n\n/**\n * C...
java
chosen
[ { "from": "human", "value": "Add auth status java servlet.\n" }, { "from": "gpt", "value": "// Copyright 2019 Google LLC\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 a copy of the...
java
chosen
[ { "from": "human", "value": "Add tests for raw text extraction\n" }, { "from": "gpt", "value": "package org.zwobble.mammoth.tests.conversion;\n\nimport org.junit.jupiter.api.Test;\nimport org.zwobble.mammoth.internal.conversion.RawText;\nimport org.zwobble.mammoth.internal.documents.Break;\nimpo...
java
chosen
[ { "from": "human", "value": "Create BufferedImageOp for flexible color rescale\n" }, { "from": "gpt", "value": "package com.kgp.imaging;\n\nimport java.awt.RenderingHints;\nimport java.awt.geom.Point2D;\nimport java.awt.geom.Rectangle2D;\nimport java.awt.image.BufferedImage;\nimport java.awt.ima...
java
chosen
[ { "from": "human", "value": "Implement metadata fixes configuration object\n" }, { "from": "gpt", "value": "package org.verapdf.metadata.fixer.impl.pb;\n\nimport org.apache.pdfbox.pdmodel.PDDocument;\nimport org.verapdf.metadata.fixer.entity.Metadata;\nimport org.verapdf.metadata.fixer.entity.PD...
java
chosen
[ { "from": "system", "value": "Fix idepotency issues in healthcheck update\n" }, { "from": "human", "value": "package io.cattle.iaas.healthcheck.process;\n\nimport static io.cattle.platform.core.model.tables.InstanceTable.*;\n\nimport io.cattle.platform.core.constants.HealthcheckConstants;\nimpor...
java
chosen
[ { "from": "human", "value": "Read in all english words" }, { "from": "gpt", "value": "package com.heynt.permutation.tests;\n\nimport java.io.IOException;\nimport java.util.Arrays;\n\nimport org.apache.commons.io.IOUtils;\n\n/**\n * Can be used to perform tests on the dictionary\n * \n * @author ...
java
chosen
[ { "from": "human", "value": "Add request for unarchiving show\n" }, { "from": "gpt", "value": "package com.alexrnl.request.shows;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\nimport com.alexrnl.request.Request;\nimport com.alexrnl.request.Verb;\n\n/**\n * Archive a show in the logged m...
java
chosen
[ { "from": "human", "value": "Fix id parse error (String can not be parsed to Long)\n" }, { "from": "gpt", "value": "package com.example.web;\n\nimport org.springframework.http.HttpStatus;\nimport org.springframework.web.bind.annotation.ControllerAdvice;\nimport org.springframework.web.bind.annot...
java
chosen
[ { "from": "human", "value": "Add a test that the admin view fragment changes\n" }, { "from": "gpt", "value": "package org.corpus_tools.annis.gui.admin;\n\nimport static com.github.mvysny.kaributesting.v8.LocatorJ._click;\nimport static com.github.mvysny.kaributesting.v8.LocatorJ._get;\nimport st...
java
chosen
[ { "from": "human", "value": "Add atomic thread safe marker annotation" }, { "from": "gpt", "value": "/*-\n * Copyright 2015 Diamond Light Source Ltd.\n *\n * All rights reserved. This program and the accompanying materials\n * are made available under the terms of the Eclipse Public License v1.0...
java
chosen
[ { "from": "human", "value": "Create class that will manage image download in background\n" }, { "from": "gpt", "value": "package com.bignerdranch.android.photogallery;\n\nimport android.os.HandlerThread;\nimport android.util.Log;\n\npublic class ThumbnailDownloader<T> extends HandlerThread {\n\n...
java
chosen
[ { "from": "human", "value": "Add assign in expression testcase\n" }, { "from": "gpt", "value": "import junit.framework.*;\n\npublic class AssignInExpr extends TestCase {\n\n public void testExpr() {\n int a = 1, b = 2, c = 3;\n\n a = b += c;\n Assert.assertEquals(b, 5);\n...
java
chosen
[ { "from": "human", "value": "Add servlet to deliver today's trending searches\n" }, { "from": "gpt", "value": "// Copyright 2021 Google LLC\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 o...
java
chosen
[ { "from": "human", "value": "Add example that clamps image values to (min, max)\n" }, { "from": "gpt", "value": "\npackage net.restlesscoder.sandbox.imagej;\n\nimport java.io.IOException;\n\nimport net.imagej.Dataset;\nimport net.imagej.ImageJ;\nimport net.imagej.ImgPlus;\nimport net.imglib2.Ran...
java
chosen
[ { "from": "human", "value": "Add shoot command for high goal shooter.\n" }, { "from": "gpt", "value": "package org.robockets.stronghold.robot.highgoalshooter;\n\nimport edu.wpi.first.wpilibj.command.Command;\nimport org.robockets.stronghold.robot.Robot;\n\n/**\n * Roll the jeff rollers to fire a...
java
chosen
[ { "from": "human", "value": "Enable gzip in springboot project" }, { "from": "gpt", "value": "@Configuration\npublic class ServerConfig {\n\n\tpublic class FaviconConfiguration extends WebMvcConfigurerAdapter{\n\t\t\n\t\t@Override\n\t\tpublic void addResourceHandlers(ResourceHandlerRegistry regi...
java
chosen
[ { "from": "human", "value": "Add tests for route matching\n" }, { "from": "gpt", "value": "/**\n * \n */\npackage com.trendrr.strest.tests;\n\nimport junit.framework.Assert;\n\nimport org.apache.commons.logging.Log;\nimport org.apache.commons.logging.LogFactory;\nimport org.junit.Test;\n\nimport...
java
chosen
[ { "from": "system", "value": "Add generated documentation for release methods\n\nChange-Id: Id29eacefc9ba8e0a38840b8c99fede7cb3055c02\n" }, { "from": "human", "value": "package com.kurento.kmf.media;\n\nimport com.kurento.kmf.media.events.ErrorEvent;\nimport com.kurento.kmf.media.events.MediaEve...
java
chosen
[ { "from": "human", "value": "Add convenience methods for Button on-click event reaction\n" }, { "from": "gpt", "value": "package moe.tristan.easyfxml.util;\n\nimport javafx.application.Platform;\nimport javafx.scene.Node;\nimport javafx.scene.control.Button;\nimport javafx.scene.input.MouseEvent...
java
chosen
[ { "from": "human", "value": "Check posix calls work on this platform\n" }, { "from": "gpt", "value": "package probos;\n\nimport static org.junit.Assert.*;\nimport jnr.posix.POSIX;\nimport jnr.posix.POSIXFactory;\n\nimport org.junit.Test;\n\npublic class TestPosix {\n\t//static final \n\n\t@Test ...
java
chosen
[ { "from": "human", "value": "Test PMoores Problem with Procedure sptestexec\n\n\ngit-svn-id: 1fece92013051e73d27f0f6eaec2bf855927aa58@23 97a8069c-bbaa-4fa2-9e49-561d8e0b19ef\n" }, { "from": "gpt", "value": "/*\n * AsTest.java\n *\n * Created on 10. September 2001, 09:44\n */\n\npackage freetds;\...
java
chosen
[ { "from": "human", "value": "Add a simple, fast, threadsafe file cache\n" }, { "from": "gpt", "value": "/**\n * \n */\npackage com.trendrr.oss;\n\nimport java.util.concurrent.ConcurrentHashMap;\n\nimport org.apache.commons.logging.Log;\nimport org.apache.commons.logging.LogFactory;\n\nimport com...
java
chosen
[ { "from": "human", "value": "Move to subproject, Jackson annotations and remove classes, evolution refactor (I111).\n" }, { "from": "gpt", "value": "/**\n * \n */\n/**\n * @author roart\n *\n */\nmodule iclij.evolutionchromosome {\n exports roart.iclij.evolution.marketfilter.chromosome.impl;\...
java
chosen
[ { "from": "human", "value": "Create a skeleton for problem 72\n" }, { "from": "gpt", "value": "package leetcode;\n\n/**\n * https://leetcode.com/problems/edit-distance/\n */\npublic class Problem72 {\n public int minDistance(String word1, String word2) {\n // TODO\n return 0;\n ...
java
chosen
[ { "from": "human", "value": "Add minimal do nothig application\n" }, { "from": "gpt", "value": "package starpunk;\n\nimport com.badlogic.gdx.ApplicationListener;\nimport com.badlogic.gdx.backends.lwjgl.LwjglApplication;\nimport com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;\n\npu...
java
chosen
[ { "from": "human", "value": "Move code to send WOL packet into library\n" }, { "from": "gpt", "value": "package com.lightbulbz.net;\n\nimport java.io.IOException;\nimport java.net.*;\n\n/**\n * Created by kevin on 6/3/15.\n */\npublic class WOLPacketSender {\n private static final byte FF = (...
java
chosen
[ { "from": "human", "value": "Add custom upload progress RequestBody.\n" }, { "from": "gpt", "value": "package com.zulip.android.networking;\n\nimport java.io.IOException;\n\nimport okhttp3.MediaType;\nimport okhttp3.ResponseBody;\nimport okio.Buffer;\nimport okio.BufferedSource;\nimport okio.For...
java
chosen
[ { "from": "human", "value": "Update Test for Student class\n" }, { "from": "gpt", "value": "package checkpoint.andela.members;\n\nimport org.junit.Test;\nimport checkpoint.andela.main.Book;\n\nimport static org.junit.Assert.*;\n\n/**\n * Created by Semiu on 26/11/2015.\n */\npublic class Student...
java
chosen
[ { "from": "human", "value": "Add cloudwatch reporter test. Requires manual verification...but have verified that the mechanics do work.\n" }, { "from": "gpt", "value": "/*\n * Copyright 2015 Attribyte, LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not ...
java
chosen
[ { "from": "human", "value": "Add the base class for the FantasyKingdoms API.\n\nNote to Tobs: I store APIs for all mods in boilerplate at the moment - which is a slightly odd design decision, but go with it :P\n" }, { "from": "gpt", "value": "@API(apiVersion = \"1.0.0\", owner = \"Boilerplate\",...
java
chosen
[ { "from": "human", "value": "Add java solution for 18. 4Sum\n\n18. 4Sum: https://leetcode.com/problems/4sum/" }, { "from": "gpt", "value": "package leetcode._4sum;\n\nimport java.util.ArrayList;\nimport java.util.Arrays;\n\npublic class Solution {\n public ArrayList<ArrayList<Integer>> fourSu...
java
chosen
[ { "from": "human", "value": "Add an event handler to deal with missing item mappings.\n" }, { "from": "gpt", "value": "package net.darkmorford.btweagles.eventhandler;\n\nimport net.darkmorford.btweagles.BetterThanWeagles;\nimport net.minecraft.item.Item;\nimport net.minecraftforge.event.Registry...
java
chosen
[ { "from": "human", "value": "Add helper for single-formula calculators\n" }, { "from": "gpt", "value": "package openmods.calc;\n\nimport com.google.common.base.Strings;\nimport com.google.common.base.Supplier;\nimport openmods.Log;\n\npublic class SingleExprEvaluator<E, M> {\n\n\tpublic interfac...
java
chosen
[ { "from": "human", "value": "Change label for myplaces link\n" }, { "from": "gpt", "value": "package flyway.myplaces;\n\nimport fi.nls.oskari.domain.map.OskariLayer;\nimport org.flywaydb.core.api.migration.BaseJavaMigration;\nimport org.flywaydb.core.api.migration.Context;\nimport org.json.JSONE...
java
chosen
[ { "from": "human", "value": "Create : 27 Remove Element\n" }, { "from": "gpt", "value": "public class Solution {\n\n public int removeElement(int[] nums, int val) {\n\n int lenCount = 0;\n\n for (int i = 0; i < nums.length; i++) {\n\n if (nums[i] != val) {\n ...
java
chosen
[ { "from": "human", "value": "Create unit test to package provider type.\n" }, { "from": "gpt", "value": "package com.github.aureliano.achmed.resources.types;\n\nimport static org.junit.Assert.assertEquals;\n\nimport static com.github.aureliano.achmed.resources.types.PackageProvider.*;\nimport st...
java
chosen
[ { "from": "human", "value": "Test for rule where a URL is configured as the source json\n\n\nFormer-commit-id: cda9e44042c47044dd06c31804e9ad8be95399fe" }, { "from": "gpt", "value": "import io.specto.hoverfly.junit.HoverflyRule;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit...
java
chosen
[ { "from": "human", "value": "Add missing file from previous commit.\n\n+review REVIEW-5481\n" }, { "from": "gpt", "value": "/*\n * Copyright 2015 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in comp...
java
chosen
[ { "from": "human", "value": "Add a very simple killer.\n" }, { "from": "gpt", "value": "/*\n Copyright (C) 2011-2014 AC Inc. (Andy Cheung)\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 ob...
java
chosen
[ { "from": "human", "value": "Add a multithreaded annotation that will allow forklift to spin up a\nspecified number of threads to run a processor." }, { "from": "gpt", "value": "package forklift.decorators;\n\nimport java.lang.annotation.Documented;\nimport java.lang.annotation.ElementType;\nimp...
java
chosen
[ { "from": "human", "value": "Add java solution for 155. Min Stack\n\n155. Min Stack: https://leetcode.com/problems/min-stack/" }, { "from": "gpt", "value": "package leetcode.min_stack;\n\nclass MinStack {\n\tprivate static final int SIZE = 100000;\n\tprivate int[] mList = new int[SIZE];\n\tpriva...
java
chosen
[ { "from": "human", "value": "Add Find Minimum in Rotated Sortes Array\n" }, { "from": "gpt", "value": "package problems;\n\npublic class FindMinInRotatedSortedArray {\n public int findMin(int[] num) {\n if (num == null || num.length == 0)\n return 0;\n\n return findMi...
java
chosen
[ { "from": "human", "value": "Add in Generic Typecast support\n" }, { "from": "gpt", "value": "package us.crast.mondochest.util;\n\npublic class GenericUtil {\n @SuppressWarnings(\"unchecked\")\n public static <T> T cast(Object x) {\n return (T) x;\n }\n}\n" } ]
java
chosen
[ { "from": "human", "value": "Add a test to watch merge duration during dev." }, { "from": "gpt", "value": "package com.opcoach.e4.modelmerger.test;\n\nimport static org.junit.Assert.assertTrue;\n\nimport org.junit.Test;\n\npublic class TestMergeDuration extends TestMerge {\n\n\t\n\t@Test\n\tpubl...
java
chosen
[ { "from": "human", "value": "Implement concrete implementation of ReadInstruction\n" }, { "from": "gpt", "value": "package readinstruction;\n\nimport java.util.UUID;\n\n/**\n * Created by Karol on 2017-04-20.\n */\npublic class ReadInstructionImpl extends ReadInstruction {\n public ReadInstru...
java
chosen
[ { "from": "human", "value": "Add default implementation of Subsample interface.\n" }, { "from": "gpt", "value": "package net.imagej.ops.views;\n\nimport net.imagej.ops.view.ViewOps;\nimport net.imagej.ops.view.ViewOps.Subsample;\nimport net.imglib2.RandomAccessible;\nimport net.imglib2.view.Subs...
java
chosen
[ { "from": "human", "value": "Add unit tests for ScratchObjects\n" }, { "from": "gpt", "value": "package scratchlib.objects;\n\nimport static org.hamcrest.CoreMatchers.instanceOf;\nimport static org.junit.Assert.assertEquals;\nimport static org.junit.Assert.assertFalse;\nimport static org.junit.A...
java
chosen
[ { "from": "human", "value": "Add composite iterator to join 2 iterators together" }, { "from": "gpt", "value": "/*\n * IteratorComposite.java\n *\n * Author: Ming Tsang\n * Copyright (c) 2015 Ming Tsang\n * Refer to LICENSE for details\n */\n\npackage com.nkming.utils.type;\n\nimport java.util.I...
java
chosen
[ { "from": "human", "value": "Add periodic update and heartbeat messages\n" }, { "from": "gpt", "value": "package net.openhft.chronicle.wire;\n\n/**\n * Created by peter on 05/06/2017.\n */\npublic interface MethodFilter {\n boolean shouldHandleMessage(String method, Object firstArg);\n}\n" ...
java
chosen
[ { "from": "human", "value": "Add test which checks for duplicate entries in messages.properties" }, { "from": "gpt", "value": "/*\n * ARX: Powerful Data Anonymization\n * Copyright 2012 - 2016 Fabian Prasser, Florian Kohlmayer and contributors\n * \n * Licensed under the Apache License, Version ...
java
chosen
[ { "from": "human", "value": "[FLINK-16302][rest] Add tests for (un)marshalling LogListInfo\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 work for additi...
java
chosen
[ { "from": "human", "value": "Add a test for SpanishWikipediaRule\n" }, { "from": "gpt", "value": "/* LanguageTool, a natural language style checker \n * Copyright (C) 2018 Daniel Naber (http://www.danielnaber.de)\n * \n * This library is free software; you can redistribute it and/or\n * modify i...
java
chosen
[ { "from": "human", "value": "Split functions out from Expression.java into separate classes.\n" }, { "from": "gpt", "value": "/*\n * This file is part of Mapyrus, software for plotting maps.\n * Copyright (C) 2003 Simon Chenery.\n *\n * Mapyrus is free software; you can redistribute it and/or mo...
java
chosen
[ { "from": "human", "value": "Allow the line separator to be configured to match your source control if you like. Otherwise it will now use the platform default" }, { "from": "gpt", "value": "package net.stickycode.plugin.bounds;\n\npublic enum LineSeparator {\n Mac {\n\n @Override\n publi...
java
chosen
[ { "from": "human", "value": "Test cases for non-short-circuit evaluation\n\n\ngit-svn-id: e7d6bde23f017c9ff4efd468d79d66def666766b@2029 eae3c2d3-9b19-0410-a86e-396b6ccb6ab3\n" }, { "from": "gpt", "value": "\nclass NonShortCircuit {\n boolean and( boolean x, boolean y) {\n\treturn x & y;\n\t}\n ...
java
chosen
[ { "from": "human", "value": "Add anything to application context here\n\n" }, { "from": "gpt", "value": "package org.flymine.web;\n\n/*\n * Copyright (C) 2002-2003 FlyMine\n *\n * This code may be freely distributed and modified under the\n * terms of the GNU Lesser General Public Licence. This...
java
chosen
[ { "from": "human", "value": "Add another shared noncompile test.\n" }, { "from": "gpt", "value": "/**\n * Check that method without return is not accepted.\n *\n * @author Elvis Stansvik <elvstone@gmail.com>\n */\nclass MissingReturn {\n public static void main(String[] args) {\n }\n}\ncla...
java
chosen
[ { "from": "human", "value": "Add to decode the color map\n" }, { "from": "gpt", "value": "package org.csstudio.utility.adlparser.fileParser;\n\nimport java.util.ArrayList;\n\nimport org.csstudio.utility.adlparser.internationalization.Messages;\nimport org.eclipse.swt.graphics.RGB;\n\npublic clas...
java
chosen
[ { "from": "human", "value": "Convert Sorted List to Binary Search Tree\n" }, { "from": "gpt", "value": "/*\n * Key point: fast/slow runner technique to find middle node, \n * time complexity is O(nlgn) which comes from f(n) = 2f(n/2) + cn\n *\n * There is a O(n) solution that build the BST b...
java
chosen
[ { "from": "human", "value": "Refactor the writing of sections more object oriented." }, { "from": "gpt", "value": "/*\n * Copyright 2018 Volker Berlin (i-net software)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance wit...
java
chosen
[ { "from": "human", "value": "Add new enum to know kind of new node will be inserted in the tree (JTreeWrapper class)\n" }, { "from": "gpt", "value": "package rose.project.passmember.util;\n\n/**\n * Created by Lord Rose on 07/04/2017.\n */\npublic enum EntryType {\n SIMPLE_PASSWORD,\n FOLD...
java
chosen
[ { "from": "human", "value": "Implement basic function call server\n" }, { "from": "gpt", "value": "/******************************************************************************\n *\n * CS 6421 - Simple Conversation\n * Compilation: javac ConvServer.java\n * Execution: java ConvServer po...
java
chosen
[ { "from": "human", "value": "Add example for sending http post request via UrlConnection" }, { "from": "gpt", "value": "package de.asw.java.training2016.net;\n\nimport java.io.PrintStream;\nimport java.net.HttpURLConnection;\nimport java.net.URL;\nimport java.net.URLConnection;\nimport java.util...
java
chosen
[ { "from": "human", "value": "XWIKI-19731: Fix escaping\n* add test\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 redistribute it and/or modify it\n * unde...
java
chosen
[ { "from": "human", "value": "Implement a main model class with serialization\n" }, { "from": "gpt", "value": "package babysteps.model;\n\nimport java.util.List;\nimport java.io.FileInputStream;\nimport java.io.FileOutputStream;\nimport java.io.IOException;\nimport java.io.ObjectInputStream;\nimp...
java
chosen
[ { "from": "human", "value": "Add java solution for 84. Largest Rectangle in Histogram\n\n84. Largest Rectangle in Histogram: https://leetcode.com/problems/largest-rectangle-in-histogram/" }, { "from": "gpt", "value": "package leetcode.largest_rectangle_in_histogram;\n\nimport java.util.Stack;\n\...
java
chosen
[ { "from": "human", "value": "Add a simple createimg that uses DoubleType\n\nThis fixes the README.md example.\n" }, { "from": "gpt", "value": "/*\n * #%L\n * ImageJ software for multidimensional image processing and analysis.\n * %%\n * Copyright (C) 2014 Board of Regents of the University of\n ...
java
chosen
[ { "from": "human", "value": "Add basic simple command unit test\n" }, { "from": "gpt", "value": "/*\n * Copyright 2017 Viktor Csomor\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 a...
java
chosen
[ { "from": "human", "value": "Add java solution for 216. Combination Sum III\n\n216. Combination Sum III: https://leetcode.com/problems/combination-sum-iii/" }, { "from": "gpt", "value": "package leetcode.combination_sum_iii;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\npublic class ...
java
chosen
[ { "from": "human", "value": "Add scuba logging and action graph instrumentation event\n\nSummary:\nWe want to add scuba logging of stats of action graph construction.\nThis adds the Events necessary and make the appropriate changes to ScubaEventListener.\n\nTest Plan: Unit test\n\nReviewed By: sbalabanov\n\...
java
chosen
[ { "from": "human", "value": "Add a safe view flipper to prevent crashes during screen rotations while\nflipper is flipping.\n" }, { "from": "gpt", "value": "/* @(#)SafeViewFlipper.java\n *\n *========================================================================\n * Copyright 2011 by Zeo Inc. ...
java
chosen
[ { "from": "human", "value": "Add default implementation of MaxFilterOp\n\nSigned-off-by: squareys <b4e1335d2c774058f7a95112f52894dcc752fd3f@googlemail.com>\n" }, { "from": "gpt", "value": "\npackage net.imagej.ops.filter.max;\n\nimport net.imagej.ops.ComputerOp;\nimport net.imagej.ops.Ops;\nimpo...
java
chosen
[ { "from": "human", "value": "Add some tests to problem 25\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 inner class for configuration\n" }, { "from": "gpt", "value": "/*\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 a copy of the License at\n *\n * ht...
java
chosen
[ { "from": "human", "value": "Add example session attribute listener\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 */\npacka...
java
chosen
[ { "from": "human", "value": "Add stream and parallel stream example" }, { "from": "gpt", "value": "package java8intro.java8.stream;\r\n\r\nimport java.util.Arrays;\r\nimport java.util.List;\r\nimport java.util.stream.Collectors;\r\n\r\npublic class StreamExample {\r\n\tprivate final List<Integer...
java
chosen
[ { "from": "human", "value": "Add util methods to attach other streams to the process' streams. That is important in order to directly read the output from the process. With that it will be possible to determine the version of docker compose.\n" }, { "from": "gpt", "value": "package processbuilde...
java
chosen
[ { "from": "human", "value": "Add missing file from previous merge\n\ngit-svn-id: 3948e88432e1a59e1cb2bc472f8f957688004121@2113 67b53d14-2c14-4ace-a08f-0dab2b34000c\n" }, { "from": "gpt", "value": "/*\n * $Id: TranslatableMarker.java 1417 2006-11-03 14:57:33 +0000 (Fri, 03 Nov 2006) rodneykinney ...
java
chosen
[ { "from": "system", "value": "JNI: Declare instance event type flags static.\n" }, { "from": "human", "value": "\npackage Mapper;\n\npublic class InstanceEventListener {\n /*! The set of possible actions on an instance, used to\n * register callbacks to inform them of what is happening. ...
java
chosen
[ { "from": "human", "value": "Add unit tests for me.zhengjie.utils.FileUtil\n\nThese tests were written using Diffblue Cover.\n" }, { "from": "gpt", "value": "package me.zhengjie.utils;\n\nimport org.junit.Test;\nimport org.springframework.mock.web.MockMultipartFile;\n\nimport static org.junit.As...
java
chosen