messages listlengths 2 2 | source stringclasses 5
values |
|---|---|
[
{
"role": "user",
"content": "Generate a bar chart visualizing a list of 10 numbers\nnumbers = [1, 5, 6, 4, 7, 9, 3, 8, 2, 10]"
},
{
"role": "assistant",
"content": "As an AI, I'm unable to draw or show images directly. But I can definitely share code that will generate a bar chart for your list... | magicoder |
[
{
"role": "user",
"content": "Build a Python program that takes two numbers as inputs and prints the summation of both numbers 3 and 4"
},
{
"role": "assistant",
"content": "```python\n# Python program to add two numbers \n \n# This function adds two numbers \ndef add_two_numbers(num1, num2): \... | python25k |
[
{
"role": "user",
"content": "Write a Ruby script to print out the Fibonacci sequence within a specific range."
},
{
"role": "assistant",
"content": "Here is a Ruby script that generates the Fibonacci sequence within a specified range:\n\n```ruby\n\ndef fibonacci_sequence(first, last)\n fib_seq... | magicoder |
[
{
"role": "user",
"content": "docs: Add missing godocs for Commander type\n\nSigned-off-by: deadprogram <b937b287f61b7a223d4aac55072db1a5381d3bb3@hybridgroup.com>\n\n(Language: Go)\n\npackage gobot\n\ntype commander struct {\n\tcommands map[string]func(map[string]interface{}) interface{}\n}\n\n// Commander ... | commitpackft |
[
{
"role": "user",
"content": "Given a pre-written erroneous code, identify the mistakes and correct them. The code is supposed to create two classes, \"Mammal\" and \"Kangaroo\", where the \"Kangaroo\" class is a subclass of the \"Mammal\" class. The \"Kangaroo\" class should implement specific behaviors th... | magicoder |
[
{
"role": "user",
"content": "Explore the possibilities of combining CSS Grid and Flexbox in a single layout. Can you create a responsive design using both techniques?"
},
{
"role": "assistant",
"content": "Yes, it is possible to combine CSS Grid and Flexbox in a single layout and create a respo... | wizardlm |
[
{
"role": "user",
"content": "Handle label if plural or singular\n\n(Language: JavaScript)\n\nimport inflect from 'i';\nimport numeral from 'numeral';\nimport FormattedNumber from '../types/formatted_number';\nimport { GraphQLString } from 'graphql';\n\nconst { pluralize } = inflect();\n\nexport default fn ... | commitpackft |
[
{
"role": "user",
"content": "Write a function that sorts an array of strings. The strings should be sorted in ascending order, first by the number of vowels in a string, and then by the length of the string. If two strings have the same number of vowels and the same length, they should be sorted alphabetic... | magicoder |
[
{
"role": "user",
"content": "Add JSON serializion support for definitions and contexts.\n\n(Language: Java)"
},
{
"role": "assistant",
"content": "/*\n * Copyright 2014 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use ... | commitpackft |
[
{
"role": "user",
"content": "Can you provide information on how to acquire a handcrafted wooden hairpin, intricately designed with cherry blossom petals and gold dust? Could you also explain the cultural significance behind the cherry blossom design in Japanese culture? Moreover, are there any options to c... | wizardlm |
[
{
"role": "user",
"content": "Derive an array consisting of every individual word present within the provided text string that possesses a length exceeding 4 characters. Additionally, each word in the array should be reversed (i.e., 'sentence' should become 'ecnetnes'). Lastly, implement a feature to count ... | magicoder |
[
{
"role": "user",
"content": "Make public path auto to resolve appropriate css relative paths\n\n(Language: TypeScript)\n\nimport MiniCssExtractPlugin from 'mini-css-extract-plugin';\nimport { RuleSetRule } from 'webpack';\nimport { notBoolean } from '../../utils/not-boolean.js';\nimport { getCssLoaderOptio... | commitpackft |
[
{
"role": "user",
"content": "Devise a Python function to compute the symmetric discrepancy amongst two sets. Specifically, take into account two sets: set1 consisting of {1, 2, 3, 5, 7} and set2 composed of {3, 4, 5, 6}. Cross-evaluate these sets to accomplish this task."
},
{
"role": "assistant",
... | magicoder |
[
{
"role": "user",
"content": "Compose a Python subroutine aimed at converting a unique string, provided as input, into its corresponding unicode normalization form and afterwards, into its lowercase form (use the unicodedata module). The input string contains higher level Unicode characters and your functio... | magicoder |
[
{
"role": "user",
"content": "Enable user and site model policies\n\n(Language: Python)\n\nfrom .model_policy_Slice import *\nfrom .model_policy_User import *\nfrom .model_policy_Network import *\nfrom .model_policy_Site import *\nfrom .model_policy_SitePrivilege import *\nfrom .model_policy_SlicePrivilege ... | commitpackft |
[
{
"role": "user",
"content": "Remove 'use strict' because using eslint\n\n(Language: TypeScript)\n\n'use strict';\n\nimport path = require('path');\nimport * as operatingSystem from '../../src/workspace/operatingSystem';\nimport * as jsonFile from '../../src/workspace/jsonFile';\n\nexport function getConfi... | commitpackft |
[
{
"role": "user",
"content": "1. \n{\n \"database_name\": \"members_db\",\n \"database_type\": \"MySQL\",\n \"database_host\": \"localhost\",\n \"database_port\": 3306,\n \"database_username\": \"root\",\n \"database_password\": \"password\",\n \"database_tables\": [\n {\n \"table... | wizardlm |
[
{
"role": "user",
"content": "Given an assembly language program running on a 16-bit Intel 8086 processor, consider the following example where the DS segment register's value is 1234h and SI index register's value is 5678h:\n```\nmov ax, DS\nmov bx, SI\n```\nThe execution of DS:[SI] is used to generate a p... | magicoder |
[
{
"role": "user",
"content": "I would like you to formulate an SQL script that will not only retrieve all the database entries where the respective score is equal to or surpasses a predefined threshold value, but also orders these results based on another column (e.g., timestamp, user-id). Additionally, it ... | magicoder |
[
{
"role": "user",
"content": "Using both chemical and physical properties, describe the crystalline structure of table salt (NaCl) in detail, including its lattice structure, unit cell dimensions, and the arrangement of its constituent ions. Additionally, provide a detailed analysis of the bonding interacti... | wizardlm |
[
{
"role": "user",
"content": "Create a program in Python that counts the number of vowels in a given string"
},
{
"role": "assistant",
"content": "```python\ndef count_vowels(string):\n vowels = ['a', 'e', 'i', 'o', 'u']\n return sum(string.count(x) for x in vowels)\n```"
}
] | python25k |
[
{
"role": "user",
"content": "Add unittests for check app\n\n(Language: Python)"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n\n\nimport os\n\nimport sshrc.endpoints.check\n\n\ndef test_mainfunc_ok(cliargs_default, templater, mock_get_content):\n mock_get_content.return_valu... | commitpackft |
[
{
"role": "user",
"content": "In what ways can drone photography be utilized to effectively capture and analyze an array of geographic features, encompassing landforms, water bodies, and vegetation? Additionally, how can these features be classified and closely monitored over an extended period of time thro... | wizardlm |
[
{
"role": "user",
"content": "In an SQL database, I have a table named \"decimals\" which contains a column named \"value\" with decimal values, such as 0.642857. How can I write an SQL query that will convert each decimal to a fraction using a repeating pattern in the digits? Can you provide the SQL code f... | wizardlm |
[
{
"role": "user",
"content": "How can the Chinese Communist Party balance its authoritarian tendencies with democratization while also accounting for the effects of globalization on its policies and the growing influence of social media on public discourse?"
},
{
"role": "assistant",
"content": ... | wizardlm |
[
{
"role": "user",
"content": "Write a Python program that finds the longest common subsequence of two strings.\nstr1 = \"ABGXABCAB\"\nstr2 = \"ZXABGAYBCB\""
},
{
"role": "assistant",
"content": "def lcs(str1, str2):\n m = len(str1)\n n = len(str2)\n\n table = [[0] * (n + 1) for _ in ran... | codealpaca |
[
{
"role": "user",
"content": "Use config to load available id providers\n\n(Language: JavaScript)\n\n\"use strict\";\n\nvar db = require('../../models');\nvar config = require('../../config');\nvar authHelper = require('../../lib/auth-helper');\n\nmodule.exports = function(app) {\n var logger = app.get('lo... | commitpackft |
[
{
"role": "user",
"content": "Given a whole number 'base' and another whole number 'exponent', compose a computational procedure to ascertain the outcome when the 'base' is elevated to the magnitude stipulated by 'exponent'.\nbase: 2\nexponent: 3"
},
{
"role": "assistant",
"content": "You can so... | magicoder |
[
{
"role": "user",
"content": "The average age of the three members of a family is 24. If the father is twice as old as the mother, and the mother is 3 years older than the son, what is the sum of their ages?"
},
{
"role": "assistant",
"content": "Let's start by assigning variables to the unknown... | wizardlm |
[
{
"role": "user",
"content": "Explain the differences between the sorting algorithms Insertion Sort and Bubble Sort"
},
{
"role": "assistant",
"content": "Insertion sort and bubble sort are two of the most common sorting algorithms. Insertion sort is based on iterating and swapping through a lis... | codealpaca |
[
{
"role": "user",
"content": "Augment the following code:\n/*\nGiven a matrix of integers nums, find the minimum sum of any non-empty sub-matrix\nof nums. The minimum sum should be calculated by adding up all the elements in the sub-matrix. You can assume that the input matrix is a 2D matrix with at least o... | magicoder |
[
{
"role": "user",
"content": "Implement base json extraction to collection functionality\n\n(Language: Python)\n\nfrom DataObjects.Collection import Collection\nfrom ObjectFactories.ItemFactory import ItemFactory\nimport json\n\ndef main():\n updateCollection(\n Collection('item','Items', 'agarner... | commitpackft |
[
{
"role": "user",
"content": "Based on the given excel table, please modify the parking space availability status for spaces 2, 5, 6, and 9 to \"Available\". Also, add a new row for a parking space with number 11 and mark it as \"Unavailable\". Finally, sort the table by parking space number in ascending or... | wizardlm |
[
{
"role": "user",
"content": "Answer this true or false question: Is London the capital of France, a country known for its iconic Eiffel Tower, Notre-Dame Cathedral, and Louvre Museum?"
},
{
"role": "assistant",
"content": "False. London is not the capital of France. The capital of France is Par... | wizardlm |
[
{
"role": "user",
"content": "Use the provided data set to generate a bar chart in Python x-axis values: 1, 2, 3, 4\ny-axis values: 10, 12, 7, 5"
},
{
"role": "assistant",
"content": "```python\nimport matplotlib.pyplot as plt\n\nx_values = [1, 2, 3, 4]\ny_values = [10, 12, 7, 5]\n\nplt.bar(x_va... | python25k |
[
{
"role": "user",
"content": "Devise an REGEX pattern that efficiently identifies sequences characterized by the schema of three distinct numeric entities delimited by a dash symbol."
},
{
"role": "assistant",
"content": "In Python, you can use the regular expression (regex) library re to solve ... | magicoder |
[
{
"role": "user",
"content": "\\documentclass{article}\n\n\\begin{document}\n\n\\title{\\textbf{Websleak - Delivering Exceptional Designs and Websites}}\n\\author{}\n\\date{}\n\n\\maketitle\n\nWebsleak is renowned for its ability to deliver exceptional designs and websites that align with clients' unique ne... | wizardlm |
[
{
"role": "user",
"content": "Add a flag to the PV Logger service to disable periodic logging and only allow on-demand logging.\n\n(Language: Java)\n\n/*\n * Main.java\n *\n * Created on Wed Jan 14 13:03:12 EST 2004\n *\n * Copyright (c) 2004 Spallation Neutron Source\n * Oak Ridge National Laboratory\n * O... | commitpackft |
[
{
"role": "user",
"content": "Take the following sentence and remove any unnecessary words.\nI really really really want this."
},
{
"role": "assistant",
"content": "I want this."
}
] | wizardlm |
[
{
"role": "user",
"content": "How can Python be used to leverage satellite imagery data for estimating India's land area in square kilometers with precision? Considering the complexity of this task, which data format do you recommend for obtaining accurate results? Also, can you provide a sample Python code... | wizardlm |
[
{
"role": "user",
"content": "Edit this HTML code to add the Google Font “Roboto”. Also, embed CSS in the head of the document to apply this font to all h1 elements. Additionally, the original code has an error in it. Identify and correct the error.\n\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta cha... | magicoder |
[
{
"role": "user",
"content": "Assume you have a dataset containing the prices of three items as shown below:\n| Item | Price |\n|--------------|---------|\n| Fuji Apple | $2.99 |\n| Rose | $10.99 |\n| Diamond | $1000.00|\nRank the items from cheapest to most expensive based on th... | wizardlm |
[
{
"role": "user",
"content": "Could you illustrate how to transmit an HTTP GET request to this specified URL address: https://api.github.com/events, employing the requests library of Python programming language?"
},
{
"role": "assistant",
"content": "Sure, following is the code to do an HTTP GET... | magicoder |
[
{
"role": "user",
"content": "In order to conduct a comprehensive financial ratio analysis of the United States, can you provide a multi-step process to compare GDP growth rate, inflation rate, and unemployment rate with the previous year's figures using Go? Additionally, I would appreciate an explanation o... | wizardlm |
[
{
"role": "user",
"content": "How can I use an Excel table to analyze the sentiment of text data?\nAssuming I have the text data in a column named \"Text\" in an Excel table, how can I use the following Excel formula to determine if the sentiment is positive or negative?\n=IFERROR(IF(SENTIMENT(A2)=\"positiv... | wizardlm |
[
{
"role": "user",
"content": "Construct an anthology of items that comprises a meticulously compiled catalogue of a customised grocery outlet and delve into the process of maintaining store inventory. The allotted inventory items for the grocery store are as follows:\n- Apple: 10\n- Orange: 20\n- Banana: 5\... | magicoder |
[
{
"role": "user",
"content": "As a talent acquisition specialist, you have been tasked with finding a sous chef for a Michelin-starred restaurant in Tokyo. Develop a comprehensive sourcing plan that includes outreach to culinary schools, leveraging professional associations, and targeted advertisements in i... | wizardlm |
[
{
"role": "user",
"content": "Write a program to merge nested dictionaries, taking into account the preservation of shared keys. The shared keys should retain the data from both the original dictionaries by appending values into a list instead of replacing them.\n\n{\"x\": {\"y\": 4, \"z\": 5}, \"a\": {\"y\... | magicoder |
[
{
"role": "user",
"content": "Suppose we have an Excel table with the following details:\n| Person | Age | City Moved From | City Moved To |\n|--------|-----|----------------|---------------|\n| John | 5 | Los Angeles | New York |\n| Sarah | 5 | Chicago | London |\n| Tom | 5 ... | wizardlm |
[
{
"role": "user",
"content": "Fix default log level in logging\n\n(Language: JavaScript)\n\nconst winston = require('winston');\n\nmodule.exports = ({\n filename,\n level,\n transports: transports = [{ level: 'debug', type: 'Console' }],\n}) => {\n if (filename) {\n transports.push({\n type: 'Fi... | commitpackft |
[
{
"role": "user",
"content": "How would you modify the senior_women_brand table to include data on customer demographics, sales channels, and other relevant metrics? Could you explain your approach in detail and provide a step-by-step guide on how to achieve this goal? Assume that the current table is not s... | wizardlm |
[
{
"role": "user",
"content": "Write a list of 15 adjectives to describe the character in this scene.\nShe was standing outside the train station, watching the people come and go."
},
{
"role": "assistant",
"content": "1. Observant\n2. Patient\n3. Curious\n4. Reserved\n5. Calm\n6. Independent\n7.... | wizardlm |
[
{
"role": "user",
"content": "Use a for loop to add up all odd elements in a list\nlist=[4,5,7,9,11,3]"
},
{
"role": "assistant",
"content": "odd_total = 0\nfor element in list:\n if element % 2 != 0:\n odd_total += element\nprint(odd_total) # Prints 25"
}
] | codealpaca |
[
{
"role": "user",
"content": "How would you modify the given R code to allow for the user to input the number of modifications they want for their ideal pet? Additionally, how would you modify the output message to list out all the modifications selected by the user, rather than just three?\n\n````R\n# crea... | wizardlm |
[
{
"role": "user",
"content": "Add py solution for 678. Valid Parenthesis String\n\n678. Valid Parenthesis String: https://leetcode.com/problems/valid-parenthesis-string/\n\nApproach1:\n DFS with cutting\n\n(Language: Python)"
},
{
"role": "assistant",
"content": "from collections import Count... | commitpackft |
[
{
"role": "user",
"content": "Design a Python function that performs a binary search-based insertion sort on a list of n integers. Then, without using any third-party libraries, implement an additional function to estimate the time complexity of your sort function in Big O notation, taking into account the ... | magicoder |
[
{
"role": "user",
"content": "The numerical series $1, 1, 1, 3, 5, 9, 17, 31, 57, 105, 193, 355, 653, 1201, \\dots$ is established by the conditions $T_1 = T_2 = T_3 = 1$ and $T_n = T_{n - 1} + T_{n - 2} + T_{n - 3}$.\n\nIt has been demonstrated that the integer $27$ does not factor into any elements of thi... | magicoder |
[
{
"role": "user",
"content": "Develop a Python function that not only prints all the values in a given dictionary but also records the count of unique values present. The dictionary for this task is as follows: { \"a\": 1, \"b\": 2, \"c\": 3 }"
},
{
"role": "assistant",
"content": "Here is a Py... | magicoder |
[
{
"role": "user",
"content": "Generate a list of unique numbers between A and B where both A and B are input parameters.\na = 0\nb = 5"
},
{
"role": "assistant",
"content": "def create_list(a, b):\n\tresult = []\n\tfor i in range(a, b+1):\n\t\tif i not in result:\n\t\t\tresult.append(i)\n\tretur... | codealpaca |
[
{
"role": "user",
"content": "Implement and invoke a function that computes the entire gamut of possible combinations and permutations derived from a specified set of integers, with each resulting subset comprising exactly three elements.\n[1, 2, 3]"
},
{
"role": "assistant",
"content": "Here is... | magicoder |
[
{
"role": "user",
"content": "Create a program that reads two numbers and performs the following tasks:\n\n1. Check if either of the numbers is negative; return an error message if true.\n2. Determine all the factors of both numbers.\n3. Create a function to identify the intersection of factors for both num... | magicoder |
[
{
"role": "user",
"content": "Could you provide a comprehensive explanation of the various components of the chant that you intend to modify? It would be helpful if you could specify the particular aspects of the lyrics that you aim to alter, whether it is the addition of fresh verses, the modification of t... | wizardlm |
[
{
"role": "user",
"content": "Implement a function in Python that takes a nested list as an input, and flattens the list into a single list [[1,2,3],[4,5,6],[7,8,9]]"
},
{
"role": "assistant",
"content": "```python\ndef flatten_list(list):\n flattened_list = []\n for sublist in list:\n for item ... | python25k |
[
{
"role": "user",
"content": "Devise a computational procedure for identifying the middle-most element within a pre-specified array of integers. Additionally, ensure your solution handles arrays of any length and provides the two middle elements if length is an even number. [2, 5, 7, 4, 3, 6]"
},
{
... | magicoder |
[
{
"role": "user",
"content": "I need help with this issue: Identify Most Frequently Updated Record\nHere are the details: SQL Schema"
},
{
"role": "assistant",
"content": "To identify most frequently updated records, you presumably have some timestamp or version fields in your database records. ... | magicoder |
[
{
"role": "user",
"content": "Write a Python code snippet to calculate the area of a triangle with side lengths 3, 4, and 5."
},
{
"role": "assistant",
"content": "def area(a, b, c):\n s = (a + b + c) / 2\n return (s*(s-a)*(s-b)*(s-c)) ** 0.5\n\nprint(area(3, 4, 5)) # 6.0"
}
] | codealpaca |
[
{
"role": "user",
"content": "Craft a highly specialized Microservice, utilizing either Go or Scala, that is exclusively accountable for the acquisition and metamorphosis of data extracted from the Message Queuing Telemetry Transport (MQTT) protocol, and subsequently amalgamating this data into a Time-serie... | magicoder |
[
{
"role": "user",
"content": "Compose a sonnet that pays tribute to the magnificence of the cosmos and highlights the extraordinary unity and collaborative efforts of the residents of Playa del Carmen and the Riviera Maya towards a brighter tomorrow, all while incorporating metaphors that evoke a sense of d... | wizardlm |
[
{
"role": "user",
"content": "Using the given MATLAB code and the formula for correlation coefficient, what is the correlation coefficient between reading time and cognitive function score in the loaded dataset \"books.mat\"? Can we conclude that there is a significant relationship between reading and cogni... | wizardlm |
[
{
"role": "user",
"content": "Revert \"set Access-Control-Allow-Headers to *\"\n\nThis reverts commit dbe2d8f7c94d62587651a393743c513540311685.\n\n(Language: Java)\n\npackage yanagishima.filter;\n\nimport javax.servlet.*;\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\n\npublic... | commitpackft |
[
{
"role": "user",
"content": "Add failing unit test for query_intent to test RequestType reprompt\n\n(Language: Python)"
},
{
"role": "assistant",
"content": "from _ebcf_alexa import interaction_model as im\nfrom _ebcf_alexa.incoming_types import Intent\nimport pytest\n\n@pytest.fixture\ndef int... | commitpackft |
[
{
"role": "user",
"content": "stdlib: Make api directly available in stdlib\n\n(Language: Python)\n\n\"\"\"\n:py:mod:`leapp.libraries.stdlib`\nrepresents a location for functions that otherwise would be defined multiple times across leapp actors\nand at the same time, they are really useful for other actors... | commitpackft |
[
{
"role": "user",
"content": "Psychologist: Good morning, Swami. Thank you for agreeing to have this discussion with me today.\n\nPriest: Good morning, Doctor. It is my pleasure to be here.\n\nPsychologist: As a psychologist, I am interested in the concept of the self beyond the mind, but I hesitate to acce... | wizardlm |
[
{
"role": "user",
"content": "ADD Network roles unit tests\n\n(Language: Python)"
},
{
"role": "assistant",
"content": "def test_create_role(client):\n result = client.post(\"/roles/\", data={\"role\": \"admin\"})\n assert result.status_code == 200\n assert result.get_json() == {\"msg\"... | commitpackft |
[
{
"role": "user",
"content": "撰寫一段 C++ 程式碼片段,用以找出兩個陣列的交集。\narr1 = [12, 4, 17, 6, 21, 45, 33]\narr2 = [9, 21, 47, 33, 4]"
},
{
"role": "assistant",
"content": "Here is a simple solution using unordered_set in C++ language.\n\n```cpp\n#include <iostream>\n#include <unordered_set>\n#include <vector... | magicoder |
[
{
"role": "user",
"content": "Build a function in Python that takes a string as the input and prints each letter of the string on a separate line."
},
{
"role": "assistant",
"content": "def print_letters(string): \n for letter in string: \n print(letter)"
}
] | codealpaca |
[
{
"role": "user",
"content": "Have you ever had trouble properly citing a book in APA style? Are you ready to master the art of APA citation and unlock its secrets? Can you write Swift code to generate a properly formatted APA citation for a book with the following details: \n- Author: John Smith\n- Publica... | wizardlm |
[
{
"role": "user",
"content": "Write a query to find all employees whose age is between 25 and 30, whose department is Marketing, and who have been employed for at least 2 years. Additionally, return their total salary, including bonuses."
},
{
"role": "assistant",
"content": "This problem cannot... | magicoder |
[
{
"role": "user",
"content": "Design a function that validates the feasibility of interchanging units between two supplied integer arrays. It should also ascertain the transformation of the initial collection into one comprised solely of odd numerals, whilst keeping the cumulative total of elements constant... | magicoder |
[
{
"role": "user",
"content": "Enhance the code snippet for a more intricate task: \nDevelop the function to handle negative values and rounding options:\n\ndef extract_integer(number: float, round_down: bool = True) -> int:\n \"\"\" Given a float, decompose it into an integer component (largest integer \... | magicoder |
[
{
"role": "user",
"content": "What innovative methods can be implemented to minimize microplastic contamination in our oceans and waterways?"
},
{
"role": "assistant",
"content": "There are several innovative methods that can be implemented to minimize microplastic contamination in our oceans an... | wizardlm |
[
{
"role": "user",
"content": "Add object for containing metrics for a certain second\n\n(Language: Java)"
},
{
"role": "assistant",
"content": "package fault.metrics;\n\nimport fault.concurrent.LongAdder;\n\n/**\n * Created by timbrooks on 6/1/15.\n */\npublic class Second {\n\n private final... | commitpackft |
[
{
"role": "user",
"content": "Remove work-firebase package-level docs from being generated.\n\nTest: genDocs\nChange-Id: I41df0b6e00fc2c10d06f082c567b195ab8015228\n\n(Language: Java)"
},
{
"role": "assistant",
"content": "/*\n * Copyright 2018 The Android Open Source Project\n *\n * Licensed und... | commitpackft |
[
{
"role": "user",
"content": "Configure JS linter warnings for Ember deprecations\n\n(Language: JavaScript)\n\n'use strict';\n\nmodule.exports = {\n root: true,\n parser: 'babel-eslint',\n parserOptions: {\n ecmaVersion: 2018,\n sourceType: 'module',\n ecmaFeatures: {\n legacyDecorators: tr... | commitpackft |
[
{
"role": "user",
"content": "Calculate the percentage increase or decrease in the given dataset.\nFive years ago, the company had 10,000 employees and now the company has 15,000 employees."
},
{
"role": "assistant",
"content": "The percentage increase in the number of employees is:\n\n((New Val... | wizardlm |
[
{
"role": "user",
"content": "Move from junit to testng for integration tests\n\n(Language: Java)\n\npackage net.kencochrane.raven.log4j;\n\nimport net.kencochrane.raven.stub.SentryStub;\nimport org.apache.log4j.Logger;\nimport org.junit.After;\nimport org.junit.Before;\nimport org.junit.Test;\n\nimport sta... | commitpackft |
[
{
"role": "user",
"content": "Design a Java program for computing the average of a given list of numbers.\n[1, 2, 4, 5]"
},
{
"role": "assistant",
"content": "public static double computeAverage(int[] numbers){\n int sum = 0;\n for(int i=0; i<numbers.length; i++){\n sum += numbers[i... | codealpaca |
[
{
"role": "user",
"content": "Given a list that contains both integer and floating numbers, write a function that is able to identify the second highest number within that list. Numbers in the list could be positive, negative, or zero. To make it more challenging, you are not allowed to use built-in sort fu... | magicoder |
[
{
"role": "user",
"content": "Add tests for UniProt client\n\n(Language: Python)"
},
{
"role": "assistant",
"content": "from indra.databases import uniprot_client\n\ndef test_query_protein_exists():\n g = uniprot_client.query_protein('P00533')\n assert(g is not None)\n\ndef test_query_prot... | commitpackft |
[
{
"role": "user",
"content": "Optimize the code snippet by reducing its memory consumption.\nimport numpy as np\ndef runFunc(inputs):\n outputs = np.array(inputs*2)\n return outputs"
},
{
"role": "assistant",
"content": "The function `runFunc()` in the provided code snippet is simply multi... | magicoder |
[
{
"role": "user",
"content": "How can I extract the value \"Hello World\" from the given XML data which contains multiple namespaces? Please provide an XPath expression for the same.\nAlso, I am looking for a way to select all elements with a specific namespace, irrespective of their name. Can you please su... | wizardlm |
[
{
"role": "user",
"content": "Generate product descriptions for a bamboo cutting board that must be suitable for use in both home and professional kitchens, withstand daily use for at least 5 years, have a unique design element, and be accompanied by a detailed care guide for proper maintenance. Additionall... | wizardlm |
[
{
"role": "user",
"content": "Design a function in Python to find the area of a circle from the given radius 5"
},
{
"role": "assistant",
"content": "```python\ndef areaCircle(radius):\n pi = 3.14\n area = pi * (radius**2)\n return area\n\nprint(areaCircle(5)) # 78.5\n```"
}
] | python25k |
[
{
"role": "user",
"content": "Load 50 attachments for media gallery\n\n(Language: TypeScript)\n\n/**\n * @prettier\n */\nimport is from '@sindresorhus/is';\n\nimport { Collection as BackboneCollection } from '../types/backbone/Collection';\nimport { deferredToPromise } from '../../js/modules/deferred_to_pro... | commitpackft |
[
{
"role": "user",
"content": "Write an `int main()` function in C++ to print the following sequence of numbers: \n\n1, 10, 100, 1000, 10000. \n\nAlso, provide the code that includes an off by one error and explain why it's incorrect, and finally correct it."
},
{
"role": "assistant",
"content": ... | magicoder |
[
{
"role": "user",
"content": "I've heard of a few ways to implement tagging; using a mapping table between TagID and ItemID (makes sense to me, but does it scale?), adding a fixed number of possible TagID columns to ItemID (seems like a bad idea), Keeping tags in a text column that's comma separated (sounds... | magicoder |
[
{
"role": "user",
"content": "Design a switch-case statement in Java to determine if a number is a prime number or a composite number."
},
{
"role": "assistant",
"content": "In Java, a switch-case statement is not appropriate for this task because switch-case operates with fixed cases, not condi... | magicoder |
[
{
"role": "user",
"content": "Create an algorithm in Java that prints the prime numbers between 1 and 100."
},
{
"role": "assistant",
"content": "class PrimeNumber{ \n public static void main(String args[]){ \n int i,m=0,flag=0; \n int n=100;//it is the number to be checked \n m=n/2; ... | codealpaca |
[
{
"role": "user",
"content": "Calculate the period of the moon's orbit around the Earth. Use the formula T=2π√(a^3/GM), where T is the period, a is the average distance between the centers of the moon and Earth, G is the gravitational constant, and M is the mass of the Earth. The average distance between th... | wizardlm |
[
{
"role": "user",
"content": "I want to see all the different ways you can come up with, for a factorial subroutine, or program. The hope is that anyone can come here and see if they might want to learn a new language.\n\n## Ideas:\n\n\n- - - - - - - - [Polyglot](http://en.wikipedia.org/wiki/Polyglot_%28com... | magicoder |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.