conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "human", "value": "Set Kth Bit program in Java" }, { "from": "gpt", "value": "// Java implementation to set the kth bit \n\n// of the given number \n\npublic class SetKthBit { \n\n\t// function to set the kth bit \n\npublic static int setKthBit(int n, int k) {\n\n\n\n\t// kth bit of n ...
java
chosen
[ { "from": "human", "value": "IsUnique: Implement the algorithm to determine if a string has all unique characters. What if you cannot use additional data structures?\n\nCreate test which will fail. And base class which will solve problem.\n" }, { "from": "gpt", "value": "package test;\n\nimport ...
java
chosen
[ { "from": "human", "value": "Add simulator for comined simulations" }, { "from": "gpt", "value": "package de.biomedical_imaging.traJ.simulation;\n\nimport de.biomedical_imaging.traJ.Trajectory;\nimport de.biomedical_imaging.traJ.TrajectoryUtil;\n\npublic class CombinedSimulator extends AbstractS...
java
chosen
[ { "from": "human", "value": "Add virtual primary key plugin\n" }, { "from": "gpt", "value": "/*\r\n * Copyright 2012 The MyBatis Team\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You...
java
chosen
[ { "from": "human", "value": "Add class representing user data for a single competition\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// ...
java
chosen
[ { "from": "human", "value": "Solve No.1546 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": "Add Bubble Sort in Java\n" }, { "from": "gpt", "value": "package com.dev.namhoai.sort;\n\npublic class BubbleSort {\n\n public static <T extends Comparable> void sort(T[] a) {\n for (int i = 0; i < a.length; i++) {\n //last i elements are already...
java
chosen
[ { "from": "human", "value": "Test case for [ 1964520 ] Findbugs reports invalid M D BC - Unchecked/unconfirmed cast (I can't recreate it)\n\ngit-svn-id: e7d6bde23f017c9ff4efd468d79d66def666766b@9600 eae3c2d3-9b19-0410-a86e-396b6ccb6ab3\n" }, { "from": "gpt", "value": "package sfBugs;\r\n\r\nimpo...
java
chosen
[ { "from": "human", "value": "Add provider interface for initial monitor states\n" }, { "from": "gpt", "value": "/*\n * Copyright (c) 2012 Mateusz Parzonka, Eric Bodden\n * All rights reserved. This program and the accompanying materials\n * are made available under the terms of the Eclipse Publi...
java
chosen
[ { "from": "human", "value": "Add a test for paging latency.\n" }, { "from": "gpt", "value": "package net.openhft.chronicle.examples;\n\nimport net.openhft.chronicle.Chronicle;\nimport net.openhft.chronicle.ExcerptAppender;\nimport net.openhft.chronicle.IndexedChronicle;\nimport net.openhft.chron...
java
chosen
[ { "from": "human", "value": "Add a test for Ingres JNDI-based DataStore\n" }, { "from": "gpt", "value": "/*\n * GeoTools - The Open Source Java GIS Toolkit\n * http://geotools.org\n *\n * (C) 2002-2012, Open Source Geospatial Foundation (OSGeo)\n *\n * This library is free software; ...
java
chosen
[ { "from": "human", "value": "[BEAM-2057] Add a test for metrics reporting in Spark runner.\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 super super class test\n" }, { "from": "gpt", "value": "package com.sebastian_daschner.jaxrs_analyzer.analysis.results.testclasses.typeanalyzer;\n\nimport com.sebastian_daschner.jaxrs_analyzer.analysis.results.TypeUtils;\nimport com.sebastian_daschner.jaxrs_ana...
java
chosen
[ { "from": "human", "value": "Add new exception to handle invalid network partition\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 additional in...
java
chosen
[ { "from": "human", "value": "Add datamodel for self performance results.\n" }, { "from": "gpt", "value": "package datamodel;\n\npublic class PerformanceSelfMonitoring {\n private CpuUsageResults cpuUsageResults;\n\n public CpuUsageResults getCpuUsageResults() {\n return cpuUsageResu...
java
chosen
[ { "from": "human", "value": "Test the RgbUtils blending algorithm\n" }, { "from": "gpt", "value": "/*\n * Zorbage: an algebraic data hierarchy for use in numeric processing.\n *\n * Copyright (C) 2016-2019 Barry DeZonia\n * \n * Redistribution and use in source and binary forms, with or without\...
java
chosen
[ { "from": "human", "value": "Create a builder for storage\n" }, { "from": "gpt", "value": "package org.xblackcat.sjpu.storage;\r\n\r\nimport org.xblackcat.sjpu.storage.connection.IConnectionFactory;\r\nimport org.xblackcat.sjpu.storage.connection.IDatabaseSettings;\r\nimport org.xblackcat.sjpu.s...
java
chosen
[ { "from": "human", "value": "Add changeset reader for JAX-RS\n\n--HG--\nbranch : jax-rs\n" }, { "from": "gpt", "value": "package com.oreilly.com.rdf.tenuki.jaxrs;\n\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.lang.annotation.Annotation;\nimport java.lang.reflect.Type;\...
java
chosen
[ { "from": "human", "value": "Add some tests to problem 58\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 a test case, for whether a buggy method should be marked as having an unconditionally dereferenced parameter.\n\n\ngit-svn-id: e7d6bde23f017c9ff4efd468d79d66def666766b@6364 eae3c2d3-9b19-0410-a86e-396b6ccb6ab3\n" }, { "from": "gpt", "value": "package deref;\n\nim...
java
chosen
[ { "from": "human", "value": "Add tests to problem 79\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 may ...
java
chosen
[ { "from": "human", "value": "Add vanilla tier tags class that holds references to all classes" }, { "from": "gpt", "value": "package info.u_team.u_team_core.item.tier;\n\nimport net.minecraft.tags.BlockTags;\nimport net.minecraft.tags.Tag.Named;\nimport net.minecraft.world.level.block.Block;\nim...
java
chosen
[ { "from": "human", "value": "Add test coverage for `HtmlUtils`.\n\ngit-svn-id: a346edc3f722475ad04b72d65977aa35d4befd55@519 3a26569e-5468-0410-bb2f-b495330926e5\n" }, { "from": "gpt", "value": "/**\n * Copyright 2010 55 Minutes (http://www.55minutes.com)\n *\n * Licensed under the Apache License...
java
chosen
[ { "from": "human", "value": "Support for getting output of PrintingVisitor as a string.\n" }, { "from": "gpt", "value": "package de.danielbechler.diff.visitor;\n\nimport de.danielbechler.diff.visitor.PrintingVisitor;\n\npublic class ToStringVisitor extends PrintingVisitor\n{\n\tString\tstring;\n...
java
chosen
[ { "from": "human", "value": "Make file for testing registration 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 ...
java
chosen
[ { "from": "human", "value": "Check that no genes are on a sequence_level coord system. Single-coord system\n species are ignored.\n" }, { "from": "gpt", "value": "/*\n Copyright (C) 2003 EBI, GRL\n \n This library is free software; you can redistribute it and/or\n modify it under the terms of th...
java
chosen
[ { "from": "human", "value": "Add dummy jxmpp-repl junit test case\n" }, { "from": "gpt", "value": "/**\n *\n * Copyright 2018 Florian Schmaus\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...
java
chosen
[ { "from": "human", "value": "Add user-list change listener interface\n" }, { "from": "gpt", "value": "package ru.nsu.ccfit.bogush;\n\npublic interface UserListChangeListener {\n\tvoid userEntered(User user);\n\tvoid userLeft(User user);\n\tvoid userListReceived(User[] users);\n}\n" } ]
java
chosen
[ { "from": "human", "value": "Add JUnit testing skeleton for BakaProcessor\n" }, { "from": "gpt", "value": "package bakatxt.test;\n\nimport static org.junit.Assert.*;\n\nimport org.junit.AfterClass;\nimport org.junit.Test;\n\npublic class BakaProcessorTest {\n\n @AfterClass\n public static ...
java
chosen
[ { "from": "human", "value": "Add solution for HappyLadyBug problem\n" }, { "from": "gpt", "value": "/**\n * \n */\npackage algorithms.implementation;\n\nimport java.util.Scanner;\n\n/**\n * Challenge: https://www.hackerrank.com/challenges/happy-ladybugs\n * \n * @author Sudharsanan Muralidharan\...
java
chosen
[ { "from": "human", "value": "Create a skeleton for problem 166\n" }, { "from": "gpt", "value": "package leetcode;\n\n/**\n * https://leetcode.com/problems/fraction-to-recurring-decimal/\n */\npublic class Problem166 {\n public String fractionToDecimal(int numerator, int denominator) {\n ...
java
chosen
[ { "from": "human", "value": "Implement a simple function to create a timbrally-based unique id for a piece of music.\n" }, { "from": "gpt", "value": "import jAudioFeatureExtractor.ACE.DataTypes.Batch;\n\nimport java.io.File;\nimport java.util.LinkedList;\n\n/**\n * Created by Daniel McEnnis on 2...
java
chosen
[ { "from": "human", "value": "Test class for class Numbers\n" }, { "from": "gpt", "value": "package design_patterns.strategy_design_pattern;\nimport design_patterns.strategy_design_pattern.PrintNormal; \t\t// Strategy 1\nimport design_patterns.strategy_design_pattern.PrintReverse; \t \t// Strateg...
java
chosen
[ { "from": "human", "value": "Add stubby aim shooter command.\n\nThis still needs to do horizontal alignment. And what needs to be figured out is\nhow to gracefully end it.\n" }, { "from": "gpt", "value": "package org.robockets.stronghold.robot.highgoalshooter;\n\nimport org.robockets.stronghold....
java
chosen
[ { "from": "human", "value": "Enumerate supported backend databases for Narvaro\nCurrently we support MySQL and MS SQL Server\n" }, { "from": "gpt", "value": "/**\n * Narvaro: @VERSION@\n * Build Date: @DATE@\n * Commit Head: @HEAD@\n * JDK: @JDK@\n * ANT: @ANT@\n *\n */\n\npackage edu.csus.ecs.m...
java
chosen
[ { "from": "human", "value": "Add a model to store the group names and other general options\n" }, { "from": "gpt", "value": "package GeneradorMiniexamenes.model;\n\nimport java.util.HashSet;\nimport java.util.Set;\n\n/**\n * Created by Irvel on 12/4/16.\n * The set of groups to be displayed to t...
java
chosen
[ { "from": "human", "value": "Add test for the shutdown hook\n" }, { "from": "gpt", "value": "package beaform.dao;\n\nimport static org.junit.Assert.assertFalse;\n\nimport java.util.concurrent.CountDownLatch;\n\nimport javax.persistence.EntityManager;\nimport javax.persistence.EntityManagerFactor...
java
chosen
[ { "from": "human", "value": "Add a servlet which can cause DB connection leaks." }, { "from": "gpt", "value": "package org.t246osslab.easybuggy.troubles;\n\nimport java.io.IOException;\nimport java.io.PrintWriter;\nimport java.sql.Connection;\nimport java.sql.DriverManager;\nimport java.sql.SQLE...
java
chosen
[ { "from": "human", "value": "Add a new unit test\n" }, { "from": "gpt", "value": "package beaform;\n\nimport java.util.List;\n\nimport javax.persistence.EntityManager;\nimport javax.persistence.Query;\nimport javax.transaction.HeuristicMixedException;\nimport javax.transaction.HeuristicRollbackE...
java
chosen
[ { "from": "human", "value": "Add statement to problem 63\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 unit test for DarwinCoreFile" }, { "from": "gpt", "value": "/*\n * Copyright (c) 2016, Peter Ansell\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following co...
java
chosen
[ { "from": "human", "value": "Add test for building in an empty directory\n" }, { "from": "gpt", "value": "package test.modules;\n\nimport static org.junit.jupiter.api.Assertions.assertDoesNotThrow;\nimport static org.junit.jupiter.api.Assertions.assertLinesMatch;\n\nimport com.github.sormuras.ba...
java
chosen
[ { "from": "human", "value": "Add a random array generator\n" }, { "from": "gpt", "value": "package matrix4j.core;\n\n\npublic class RandomArray {\n public static double[] doubleArray(int length) {\n double[] array = new double[length];\n java.util.Random random = new java.util.R...
java
chosen
[ { "from": "human", "value": "Add slow annotations for test.\n\nUse as follows:\n\n> test-only -- -l co.theasi.plotly.Slow\n" }, { "from": "gpt", "value": "package co.theasi.plotly;\n\nimport java.lang.annotation.*;\nimport org.scalatest.TagAnnotation ;\n\n@TagAnnotation\n@Retention(RetentionPoli...
java
chosen
[ { "from": "human", "value": "Add class to hold the environment common properties\n" }, { "from": "gpt", "value": "package wumpus;\n\n/**\n * Represents the world environment.\n */\npublic class Environment {\n public enum Items {\n WUMPUS, PIT, HUNTER, GOLD\n }\n\n public enum Pe...
java
chosen
[ { "from": "human", "value": "Add some tests to problem 42\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": "Test contract of the Log annotation\n" }, { "from": "gpt", "value": "package com.github.vbauer.herald.annotation;\n\nimport org.junit.Test;\n\nimport java.lang.annotation.Annotation;\n\nimport static org.hamcrest.Matchers.equalTo;\nimport static org.junit.Assert.asse...
java
chosen
[ { "from": "human", "value": "Add junit test for SMTPAuthSuccessful matcher\n\ngit-svn-id: 88158f914d5603334254b4adf21dfd50ec107162@416426 13f79535-47bb-0310-9956-ffa450edef68\n" }, { "from": "gpt", "value": "/***********************************************************************\n * Copyright (...
java
chosen
[ { "from": "human", "value": "Add servlet to serve results.html including datastore key\n" }, { "from": "gpt", "value": "package com.google.sps.servlets;\n\nimport javax.servlet.annotation.WebServlet;\nimport javax.servlet.http.HttpServlet;\nimport javax.servlet.http.HttpServletRequest;\nimport j...
java
chosen
[ { "from": "human", "value": "Test of SquareFinder algorithm on sample image.\n" }, { "from": "gpt", "value": "package graphics.epi.test;\n\nimport android.graphics.Bitmap;\nimport android.graphics.BitmapFactory;\nimport android.os.Bundle;\nimport android.test.AndroidTestCase;\nimport android.uti...
java
chosen
[ { "from": "human", "value": "Add tests for the ImporterException\n" }, { "from": "gpt", "value": "package beaform.importer;\n\nimport static org.junit.Assert.assertEquals;\nimport static org.junit.Assert.assertNotNull;\n\nimport org.junit.Test;\n\n@SuppressWarnings(\"static-method\")\npublic cla...
java
chosen
[ { "from": "system", "value": "Fix RelaxNG tests in CE\n" }, { "from": "human", "value": "/*\n * Copyright 2007 Sascha Weinreuter\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 cop...
java
chosen
[ { "from": "human", "value": "PorcE: Add counting utility for future use.\n\nThis will be a potential replacement for the current atomic and\nsplit counters. It will be both fast to read and fast to write\nwithout any atomic operations (once we get JDK 9). This will be\nvery useful if the profiling turns out...
java
chosen
[ { "from": "human", "value": "Add dialogs for info and error cases\n" }, { "from": "gpt", "value": "package com.ysrbdlgn.audioconverter.frontend.ui;\n\nimport javafx.scene.control.Alert;\n\n/**\n * Created by ysrbdlgn on 11-Jun-17.\n */\npublic class GenericDialog {\n\n public static void show...
java
chosen
[ { "from": "human", "value": "Add the initial stab at a plugin executing scripts\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nThis used to be revision r3855.\n" }, { "from": "gpt", "value": "package imagej.ext.script;\n\nimport imagej.ext.plugin.ImageJPlugin;\nimport imag...
java
chosen
[ { "from": "system", "value": "Add more table elements attributes to whitelist\n" }, { "from": "human", "value": "package com.fsck.k9.message.html;\n\n\nimport org.jsoup.Jsoup;\nimport org.jsoup.nodes.Document;\nimport org.jsoup.safety.Cleaner;\nimport org.jsoup.safety.Whitelist;\n\n\npublic clas...
java
chosen
[ { "from": "human", "value": "Refactor in preparation for PageCount sample\n" }, { "from": "gpt", "value": "/*\r\n * Copyright 2014 Informatica Corp.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License...
java
chosen
[ { "from": "human", "value": "Add Cancel that works on thread interrupts.\n" }, { "from": "gpt", "value": "package org.metaborg.util.task;\n\n/**\n * Cancellation token implementation that cancels on thread interrupts.\n */\npublic class ThreadCancel implements ICancel {\n @Override public boo...
java
chosen
[ { "from": "human", "value": "Add tests to cover upcoming changes on RequestBuilder\n" }, { "from": "gpt", "value": "package com.braintreegateway;\n\nimport org.junit.Test;\n\nimport java.util.ArrayList;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\n\nimport static or...
java
chosen
[ { "from": "human", "value": "Manage resources using try-with-resource blocks.\nProperly close opened resources." }, { "from": "gpt", "value": "package com.salesforce.ide.core.internal.utils;\n\npublic final class QuietCloseable<T extends AutoCloseable> implements AutoCloseable {\n private fin...
java
chosen
[ { "from": "human", "value": "Enumerate values of request types stored in the database.\n" }, { "from": "gpt", "value": "package net.ghostrealms.util;\n\npublic enum Request {\n \n TOWN_JOIN(1),\n TOWN_ADD(2),\n FRIEND(3);\n \n private final int val;\n \n Request(int val) {\n this.val ...
java
chosen
[ { "from": "human", "value": "Connect to web server when device (re)boot\n" }, { "from": "gpt", "value": "package org.opendroidphp.app.services;\n\nimport android.content.BroadcastReceiver;\nimport android.content.Context;\nimport android.content.Intent;\nimport android.content.SharedPreferences;...
java
chosen
[ { "from": "human", "value": "Add JUnit test for Include class in rest modeling module.\n" }, { "from": "gpt", "value": "package org.slc.sli.modeling.rest;\n\nimport static org.junit.Assert.*;\n\nimport java.util.ArrayList;\n\nimport org.junit.Before;\nimport org.junit.Test;\n\n/**\n * JUnit test...
java
chosen
[ { "from": "human", "value": "Define a lifted Ramp procedure\n" }, { "from": "gpt", "value": "/*\n * Zorbage: an algebraic data hierarchy for use in numeric processing.\n *\n * Copyright (C) 2016-2018 Barry DeZonia\n * \n * Redistribution and use in source and binary forms, with or without\n * mo...
java
chosen
[ { "from": "human", "value": "Verify that file sizes are parsed correctly.\n" }, { "from": "gpt", "value": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information r...
java
chosen
[ { "from": "human", "value": "Implement MobSpawnerData for Forge registry\n" }, { "from": "gpt", "value": "/*\n * This file is part of Sponge, licensed under the MIT License (MIT).\n *\n * Copyright (c) SpongePowered <https://www.spongepowered.org>\n * Copyright (c) contributors\n *\n * Permissio...
java
chosen
[ { "from": "human", "value": "Add solution for 'Two strings' problem.\n" }, { "from": "gpt", "value": "import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\nimport java.util.Map;\nimport java.util.HashMap;\nimport java.util.Map;\nimport java.util.Map;\n...
java
chosen
[ { "from": "human", "value": "Create producer test on column\n" }, { "from": "gpt", "value": "/*\n * Copyright 2017 Eclipse Foundation\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 ...
java
chosen
[ { "from": "human", "value": "Add tests for default context\n" }, { "from": "gpt", "value": "package tools.devnull.trugger.factory;\n\nimport org.junit.Test;\nimport tools.devnull.kodo.TestScenario;\nimport tools.devnull.trugger.util.factory.Context;\nimport tools.devnull.trugger.util.factory.Def...
java
chosen
[ { "from": "human", "value": "Add class for undoing generic actions\n" }, { "from": "gpt", "value": "package editor.util;\n\nimport java.util.function.Supplier;\n\npublic class UndoableAction<U, R>\n{\n private final Supplier<R> forward;\n private final Supplier<U> reverse;\n\n public Un...
java
chosen
[ { "from": "human", "value": "Define a way to construct real values via scientific notation\n" }, { "from": "gpt", "value": "/*\n * Zorbage: an algebraic data hierarchy for use in numeric processing.\n *\n * Copyright (C) 2016-2018 Barry DeZonia\n * \n * Redistribution and use in source and binar...
java
chosen
[ { "from": "human", "value": "Add a simple double quoted string parser\n" }, { "from": "gpt", "value": "package org.parboiled.examples.doublequotedstring;\n\nimport org.parboiled.BaseParser;\nimport org.parboiled.Parboiled;\nimport org.parboiled.Rule;\nimport org.parboiled.annotations.BuildParseT...
java
chosen
[ { "from": "human", "value": "Test that double registration of ServletContextInitializers does not happen\n\nCloses gh-4902\n" }, { "from": "gpt", "value": "/*\n * Copyright 2012-2017 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you...
java
chosen
[ { "from": "human", "value": "Add a util class to convert cursor data to lists.\n\nGeneric converter from cursor data to a list of objects.\nUses sqldelight RowMapper helper.\n" }, { "from": "gpt", "value": "package de.philipphager.disclosure.database.util;\n\nimport android.database.Cursor;\nimp...
java
chosen
[ { "from": "human", "value": "Add some tests to problem 63\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 check digit util to framework to support making sure someone isn't randomly trying codes, resulting in db calls (e.g. offers)\n" }, { "from": "gpt", "value": "package org.broadleafcommerce.util;\r\n\r\npublic class Mod43CheckDigitUtil {\r\n\r\n private final s...
java
chosen
[ { "from": "human", "value": "Add first tests: test that the tabs are added in MainActivity\n" }, { "from": "gpt", "value": "package com.peruukki.simplecurrencyconverter;\n\nimport android.support.v4.view.ViewPager;\nimport android.support.v7.app.ActionBar;\nimport android.test.ActivityInstrument...
java
chosen
[ { "from": "human", "value": "Add a wrapper class for the pool\n" }, { "from": "gpt", "value": "package com.codacy.play.tomcatcp.pool;\n\nimport com.codacy.play.tomcatcp.metrics.MetricsTracker;\nimport com.codacy.play.tomcatcp.metrics.MetricsTrackerFactory;\nimport com.codacy.play.tomcatcp.metric...
java
chosen
[ { "from": "human", "value": "Add First Exercise Print One Astericks\n" }, { "from": "gpt", "value": "/**\n * Created by Nathan_Zeplowitz on 4/11/15.\n */\npublic class PrintOneAsterisk {\n public static void main(String[] args) {\n System.out.println(\"*\");\n }\n}\n" } ]
java
chosen
[ { "from": "human", "value": "Add java solution for 139. Word Break\n\n139. Word Break: https://leetcode.com/problems/word-break/" }, { "from": "gpt", "value": "package leetcode.word_break;\n\nimport java.util.HashSet;\nimport java.util.Set;\n\npublic class Solution {\n\tpublic boolean wordBreak(...
java
chosen
[ { "from": "human", "value": "Add a reflection command context\n\nThis won't be loaded per default as it is just some playground stuff for\nme" }, { "from": "gpt", "value": "package ch.deletescape.jterm.commandcontexts;\n\nimport java.lang.reflect.Constructor;\nimport java.lang.reflect.Method;\ni...
java
chosen
[ { "from": "human", "value": "Add Widget RemoteViews Factory, Service for Ingredients Listing\n" }, { "from": "gpt", "value": "package com.example.profbola.bakingtime.ui.widget;\nimport android.content.Context;\nimport android.content.Intent;\nimport android.database.Cursor;\nimport android.suppo...
java
chosen
[ { "from": "system", "value": "Remove unnecessary getting of read action.\n" }, { "from": "human", "value": "/*\n * Copyright 2000-2009 JetBrains s.r.o.\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 an updater interface for time series topics.\n" }, { "from": "gpt", "value": "/*******************************************************************************\n * Copyright (C) 2018 Push Technology Ltd.\n *\n * Licensed under the Apache License, Version 2.0 (the ...
java
chosen
[ { "from": "human", "value": "MQA-932: Create constraint that retrieves a value from the configuration\n" }, { "from": "gpt", "value": "package com.mgmtp.jfunk.data.generator.constraint;\n\nimport javax.inject.Inject;\nimport javax.inject.Provider;\n\nimport org.jdom.Element;\n\nimport com.mgmtp....
java
chosen
[ { "from": "human", "value": "Rename lexer tokens and rename pypyxltokentypes java\n" }, { "from": "gpt", "value": "package com.christofferklang.pyxl;\n\nimport com.jetbrains.python.psi.PyElementType;\n\npublic class PyxlTokenTypes {\n private PyxlTokenTypes() {\n // Prevent instantiati...
java
chosen
[ { "from": "human", "value": "Add test for default converter methods\n" }, { "from": "gpt", "value": "package uk.hfox.morphix.transform;\n\nimport org.junit.jupiter.api.Test;\n\nimport static org.junit.jupiter.api.Assertions.assertNotNull;\nimport static org.junit.jupiter.api.Assertions.assertNul...
java
chosen
[ { "from": "human", "value": "Add a delivery mode enum for configuring Sender and Receiver modes" }, { "from": "gpt", "value": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for add...
java
chosen
[ { "from": "human", "value": "Add class to retrieve local address\n\nChange-Id: I523e5e6cdb8fed36d8b981918e32f9842e21cf61\n" }, { "from": "gpt", "value": "package com.kurento.apps.android.content.demo.rtp;\n\nimport java.net.Inet4Address;\nimport java.net.InetAddress;\nimport java.net.NetworkInte...
java
chosen
[ { "from": "human", "value": "Add viewer for .mol2 files (molecular docking demo)\n\ngit-svn-id: 9146c88ff6d39b48099bf954d15d68f687b3fa69@8176 28e8926c-6b08-0410-baaa-805c5e19b8d6\n" }, { "from": "gpt", "value": "/**\n * \n */\npackage org.objectweb.proactive.extensions.scheduler.examples.docking...
java
chosen
[ { "from": "human", "value": "feat: Test if joke returned is valid.\n" }, { "from": "gpt", "value": "package com.udacity.gradle.builditbigger;\n\nimport android.support.test.runner.AndroidJUnit4;\nimport android.util.Log;\n\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\n\nimport stati...
java
chosen
[ { "from": "human", "value": "Add tests that checks if a DiskFPSet correctly recovers from a chkpt." }, { "from": "gpt", "value": "// Copyright (c) 2012 Microsoft Corporation. All rights reserved.\npackage tlc2.tool.fp;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.nio.file.F...
java
chosen
[ { "from": "human", "value": "Add a SpannableStringBuilder that understands when it is mounted/unmounted\n\nSummary:\nImplementation of a SpannableStringBuilder that is notified when it mounted or unmounted.\n\nThis will be used in the Bloks RichText component for rendering Vito ImageSpans. (D35146631)\n\nDi...
java
chosen
[ { "from": "human", "value": "Add \"Show New Instances\" action to context menu of Classes view\n" }, { "from": "gpt", "value": "package org.jetbrains.debugger.memory.action;\n\nimport com.intellij.openapi.actionSystem.AnActionEvent;\nimport com.intellij.openapi.project.Project;\nimport com.sun.j...
java
chosen
[ { "from": "human", "value": "Test to ensure that the proper string values are used to sort the project samples datatable.\n" }, { "from": "gpt", "value": "package ca.corefacility.bioinformatics.irida.ria.unit.components;\n\nimport static org.junit.Assert.assertEquals;\n\nimport org.junit.Test;\n...
java
chosen
[ { "from": "human", "value": "Add Config Components for Swing" }, { "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 config...
java
chosen
[ { "from": "human", "value": "Add a stdout printer for JustificationCompleteProof" }, { "from": "gpt", "value": "package org.liveontologies.protege.justification.proof.service;\n\nimport java.io.IOException;\n\nimport org.liveontologies.puli.ProofPrinter;\n\npublic class JustificationCompleteProo...
java
chosen
[ { "from": "human", "value": "Add test for spark shuffling\n" }, { "from": "gpt", "value": "package org.deeplearning4j.spark.data;\n\nimport org.apache.spark.api.java.JavaRDD;\nimport org.deeplearning4j.spark.BaseSparkTest;\nimport org.deeplearning4j.spark.util.SparkUtils;\nimport org.junit.Test;...
java
chosen
[ { "from": "human", "value": "Create a skeleton fo problem 240\n" }, { "from": "gpt", "value": "package leetcode;\n\n/**\n * https://leetcode.com/problems/search-a-2d-matrix-ii/\n */\npublic class Problem240 {\n public boolean searchMatrix(int[][] matrix, int target) {\n return false;\n...
java
chosen
[ { "from": "human", "value": "Create a skeleton for problem 330\n" }, { "from": "gpt", "value": "package leetcode;\n\n/**\n * https://leetcode.com/problems/patching-array/\n */\npublic class Problem330 {\n public int minPatches(int[] nums, int n) {\n // TODO\n return 0;\n }\n\...
java
chosen