instruction_seed
stringlengths
0
26.4k
source
stringclasses
4 values
Given a matrix of X, Y coordinates, write a Python function that returns the angle between the two points. X1 = 2 Y1 = 3 X2 = 7 Y2 = 10
codefeedback
Create a program in Java that outputs a Fibonacci series of length n.
codefeedback
Create a SQL query that returns all elements in a table with a given column value. Table: Customer column: name value: John
codefeedback
Implement a PHP function to retrieve all words that start with a given letter from a given array. $array = ["apple", "ball", "cat", "dart", "elephant"] $letter = "e"
codefeedback
Design an algorithm to reverse a singly linked list in O(n) time.
codefeedback
Write a code to find the Kth smallest element from a given array of N elements.
codefeedback
Design a Python program to find the longest increasing subsequence in a given array.
codefeedback
Suppose you are designing a simple text editor. Write a C++ code to automatically detect and remove comments from a given input string.
codefeedback
Write a JavaScript code snippet to find the sum of the even numbers in a given range using the reduce() method. let arr = [1,2,3,4,5,6,7,8,9,10];
codefeedback
Generate a string representation of a binary tree.
codefeedback
Write a TensorFlow code snippet to build a convolutional neural network and display the results of the training process.
codefeedback
Write a Java program to find the area of a triangle where the three sides are given as x, y, and z. x = 6, y = 7, z = 8
codefeedback
Given an array of objects, sort them in descending order according to their age. array = [ {name: 'John', age: 25}, {name: 'Peter', age: 32}, {name: 'Alex', age: 21} ]
codefeedback
Write a Java program to clone an array of objects.
codefeedback
Write a snippet of code to swap two variables without using the third variable a = 5 b = 10
codefeedback
Create a TensorFlow 2.0 program that takes a 3D array and normalizes the values by dividing each element by the sum of all elements in the array.
codefeedback
What is the most efficient way to insert a new element into an existing unsorted array?
codefeedback
Construct a basic data structure to store a dictionary of words and their definitions.
codefeedback
Generate a SQL query to find the names of all users whose credit scores are lower than 50.
codefeedback
Write a code for a Javascript program to return the nth Fibonacci number. 8
codefeedback
Write a code to reverse a stack and return the new stack. Stack: [1, 2, 3, 4, 5]
codefeedback
Create an array of 10 numbers in Java and assign random values from 1 to 10 to each item of the array.
codefeedback
Find the middle element of a given linked list. 1 -> 2 -> 3 -> 4 -> 5
codefeedback
Generate a random password using a given string of characters. String: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()"
codefeedback
Develop a machine learning model in Python to predict the credit risk of a customer based on their bank transaction data. <100 rows of bank transaction data>
codefeedback
Generate a method in C++ to sort a given array in descending order. arr = [3,5,1]
codefeedback
Write a method that takes a parameter, text, and returns the words in the text in reverse order. text = "Hello world!"
codefeedback
Generate HTML code for a table that displays the result of multiplication for the numbers from 1 to 10.
codefeedback
Create a method to convert a given number to Roman numeral format. num = 2020
codefeedback
Create an algorithm that takes two integers and returns the smallest common multiple of the two numbers. x = 12 y = 24
codefeedback
Create a database query that shows the average price of all items.
codefeedback
Construct a C++ code snippet to output a Fibonacci sequence with a given number of elements 7
codefeedback
Design a C++ program to convert a given number from binary to decimal. <<noinput>>
codefeedback
Design a function to input an array and sort it using QuickSort algorithm.
codefeedback
Construct a script that takes inputs from the user and prints out the Fibonacci sequence up to a given number.
codefeedback
Remove any element from an array that is greater than 10 [3, 5, 10, 20, 7]
codefeedback
Generate a regular expression that matches strings containing any number of digits, but does not contain any non-digit character.
codefeedback
Find the number of prime numbers between 1 and 100.
codefeedback
Develop a high-level algorithm for pathfinding.
codefeedback
Using React, create a component to display a table containing a list of cities.
codefeedback
Edit the SQL query to get the users from Canada who joined within the last 6 months. SELECT * FROM users
codefeedback
How would you query a database table using MySQL?
codefeedback
How can you validate a credit card number using JavaScript?
codefeedback
Calculate the value of PI using the Leibniz formula.
codefeedback
Write a SQL query to get the names and the total number of orders for each customer in a table called 'orders'.
codefeedback
Create a GraphQL query that returns all the top five countries in terms of population.
codefeedback
Write a function in C++ that takes in a string of text and removes all the punctuation from the string.
codefeedback
Create a program that will guess a number between 0 and 10.
codefeedback
Write an algorithm that takes in two integers and returns true if they are evenly divisible.
codefeedback
Read a code that prints out the Fibonacci Series.
codefeedback
Write a C++ class called Vector3D which can be used to represent a 3D vector with 3 float values.
codefeedback
Create a function in Python that prints out all prime numbers between two given numbers.
codefeedback
Write a SQL query to get all distinct posts with the highest score.
codefeedback
Write a HTML code snippet to create a 4x3 table of no border and gradient.
codefeedback
How can you write a JavaScript regular expression to validate an email address?
codefeedback
Generate a function `recursive_sum` that computes the sum of a list of integers recursively.
codefeedback
Extend the given list of numbers by adding all odd numbers from 0 to 10. my_list = [0, 2, 4, 6, 8, 10]
codefeedback
Utilize regular expressions to parse and return a list of words from a sentence. sentence = "The quick brown fox jumps over the lazy dog"
codefeedback
Create a Java program to implement the classic Tic Tac Toe game.
codefeedback
Fix the bug in this code. def calculate_area(length, width): area = (length * width) if area > 20: return 'Area too large'
codefeedback
Calculate the mean of the following list of numbers: 4, 6, 8, 10.
codefeedback
Write a Python function to sort the given array of dictionaries by key value. arr = [{'name': 'Jose', 'age': 32}, {'name': 'Ravi', 'age': 23}, {'name': 'Paul', 'age': 26}]
codefeedback
Create a Visual Studio Code extension that provides auto-complete features for a specific language.
codefeedback
Fill in the __ in the following code to print the reversed string. original_string = "Hello World" reversed_string = original_string[ __ : __ ] print(reversed_string)
codefeedback
Construct an algorithm to check for palindrome in a given string.
codefeedback
Propose a fast sorting algorithm for a list of integers
codefeedback
Design a function to generate the random password
codefeedback
Construct a block of JavaScript code to find the smallest of 3 numbers
codefeedback
Write an SQL statement that returns the salary of the employee with the highest salary of the "Employees" table.
codefeedback
Construct a valid SQL statement to calculate the sum of the "price" column in the "Orders" table
codefeedback
Reverse a string using a stack. string: hello
codefeedback
Create a jQuery function to detect when a page is scrolled.
codefeedback
Create an RNN model to classify emails into spam and not spam.
codefeedback
Develop a solution to this algorithm problem. Given an int array A, find the min absolute difference between any two of its elements.
codefeedback
Write a Java program to find the second most frequent character in a string. String: "Hello World!"
codefeedback
Describe what is polymorphism in Java.
codefeedback
Generate a random 29 character hexadecimal string using javascript.
codefeedback
Create a recursive SQL query to find the level of each node in a tree structure. WITH RECURSIVE tree_levels (node, parent, level) AS ( SELECT node, parent, 0 FROM root_table WHERE parent IS NULL UNION ALL SELECT child.node, child.parent, tree_levels.level + 1 FROM root_table AS child JOIN tr...
codefeedback
Create an algorithm to classify a given set of data into three classes.
codefeedback
Write a Python script to compute Pi to the Nth digit.
codefeedback
Design an HTML form that allows the user to submit his/her contact details.
codefeedback
Create a JavaScript function that takes a positive integer as an argument and returns the first prime number larger than that integer. num = 10
codefeedback
Create a report in PDF format that displays the most frequent words used in the New York Times articles.
codefeedback
Construct an algorithm to predict the next 3 days' stock market movements given the stock prices from the past 5 days. [69.04, 67.07, 68.3, 68.91, 70.09]
codefeedback
Construct a classifier to identify which programming language a given code snippet belongs to. def foo(x, y): return x + y
codefeedback
Write a function to implement the Levenshtein Distance algorithm. The Levenshtein Distance algorithm calculates the minimum number of single-character edits (insertions, deletions, or substitutions) necessary to transform one string into another string. "cats", "dogs"
codefeedback
Create a function that takes a list of strings as input and returns a string of the list sorted in the alphabetical order. ["apple", "banana", "cherry"]
codefeedback
Create a regex expression to match with a specific format of email address.
codefeedback
Perform sentiment analysis on the following sentence and indicate if it is positive or negative. Sentence: I had a really bad experience at the shop.
codefeedback
Generate a regular expression to match the following patterns wxyz - w:[a-c] x:[0-9] y:[a-z] z:[A-Z]
codefeedback
Generate valid HTML for a table with three columns
codefeedback
Write a Python script to find the maximum depth of a given nested list. nested_list = [[1,2], [3,4], [5,6,7]]
codefeedback
Construct a while loop with an if-else statement in Java to print all odd numbers between 1 to 10.
codefeedback
Provide a list of all the functionality available to a React Native application.
codefeedback
Given an array of integers, write an algorithm to sort them in an ascending order. arr = [23, 32, 19, 17, -5, 3]
codefeedback
Write a SQL query to find the name of the top 10 highest salary employees in the company.
codefeedback
Build a TensorFlow model to perform sentiment analysis on text.
codefeedback
Write a Python code snippet to get the first 1000 prime numbers.
codefeedback
Create a function to flatten a 2D array. [[1, 2], [3, 4], [5, 6]]
codefeedback
Develop a code to rotate a given list by a given value. my_list = [1, 2, 3, 4, 5] k = 3
codefeedback