instruction_seed
stringlengths
0
26.4k
source
stringclasses
4 values
Train a neural network using TensorFlow to predict housing prices.
codefeedback
Use the string `'Hello world!'` and print it reversed.
codefeedback
Create a low-level PyTorch implementation of the following neural network structure, using the class PyTorch provides. Input shape: (300, 100) Output shape: (2, 5)
codefeedback
How would you fill in the blanks in the following code to make it print "Hello, World" n times in a row? n = 5 for _ in range(n): ________
codefeedback
Make the following C++ program print "Hello, World" 10 times consecutively. #include<iostream> int main() { ________ return 0; }
codefeedback
Use a machine learning model to predict the next number in a given sequence. Sequence: [1, 4, 9, 16, 25]
codefeedback
Change the line in the following code that contains a syntax error. x = 10 if x == 10 print('x is 10')
codefeedback
Create a regex to extract the first name from a string "John Doe is a programmer". "John Doe is a programmer"
codefeedback
Describe what a closure is in programming.
codefeedback
Construct a SQL query to retrieve the top 10 most viewed articles from the database. Table "articles": - id (integer) - title (string) - content (string) - views (integer)
codefeedback
Create an algorithm that prints the common elements of two arrays. arr1 = [3, 10, 15, 7] arr2 = [7, 8, 5, 10]
codefeedback
Implement the quicksort algorithm. [12, -6, 47, 18, 0, -3]
codefeedback
Describe the difference between an abstract class and an interface in Java
codefeedback
Design a GUI using JavaScript for a calculator application.
codefeedback
How can you find all the subsets of a set in Python?
codefeedback
Create a program to generate the Pascal's triangle
codefeedback
Swap the two variables without using a temporary variable a = 3 b = 7
codefeedback
Generate an array of length n that contains the square of the numbers from 1 to n. n = 10
codefeedback
Find all the factors of N (greater than 0), add them together and return the result. N = 30
codefeedback
Convert a given binary number to a hexadecimal number. binary_num = 1011
codefeedback
Compute the maximum sum of m consecutive values in a given array. arr = [2, 6, 1, 3, 7, 4, 9] m = 3
codefeedback
Write a Haskell code snippet to find the length of a given list.
codefeedback
Create a Java function to calculate the area of a triangle from its three vertices. A=(2,3), B=(3,4), C=(4,5).
codefeedback
Implement a method to generate a random password with 8 characters, which at least contain one capital letter, one small letter, and one digit.
codefeedback
Write a method in Java that returns an array of the first N prime numbers. n=10
codefeedback
Using list comprehension, write a Python code to get a list of all possible subsets of the list [1, 2, 3] [1, 2, 3]
codefeedback
In Java, write code to remove all empty elements from an array. arr = [1, 2, 3, "", 4, 5, "", 6]
codefeedback
Write a code that finds the largest palindromic number in a given array [73, 111, 109]
codefeedback
Write a function to print an array without duplicate elements. [4,3,6,5,4,7]
codefeedback
Create a function to detect if a given string contains all letters of the English alphabet.
codefeedback
Identify and correct the error in this C++ code. #include<iostream> using namespace std; void main() { int a=2; if(a=1) cout<<"1"; else cout<<"2"; }
codefeedback
Generate a correct SQL query to select the three highest-priced products in a product table.
codefeedback
Develop a logistic regression model using Python to predict the outcome of a binary classification dataset.
codefeedback
Build a graphical user interface using Java.
codefeedback
Write a function to delete an element from a given array [1, 2, 3, 4], 3
codefeedback
Create an HTML form with 3 input boxes to get user name, email, and phone number.
codefeedback
Ask the user to input a positive integer and find the sum of all positive integers up to that number.
codefeedback
Create a function to add two numbers without using the + operator.
codefeedback
Develop an algorithm for a breadth-first search.
codefeedback
Print out the elements of the list in reverse order without using the reverse() method. list_of_words = ["Hello", "World", "How", "Are", "You"]
codefeedback
Write a script to sort an array of numbers from largest to smallest using quick sort.
codefeedback
Create a function that recursively flattens an array of arbitrarily nested arrays. array = [[1, [2, [3, [[4, 5], 6]]]], 7]
codefeedback
Check if two strings are an anagram of each other. string1 = "elbon" string2 = "noble"
codefeedback
Compress the following string using a Huffman algorithm. "aaaaaaaaabccddddee"
codefeedback
Given an array with n numbers, write a function to find if there exists three elements in the array whose sum is equal to a given number. array = [5, 3, 1, 8], number = 14
codefeedback
Compute the bulk density of a polyhedron using the formula $\frac{mass}{volume}$. mass = 3.5 g, volume = 2.6 cm$^3$
codefeedback
Write a function that converts a number to its corresponding month name. 4
codefeedback
Write a function that computes the factorial of a positive integer. 8
codefeedback
Write a function to retrieve and reverse the order of all words in a sentence. sentence = "This is a sentence."
codefeedback
Perform insertion sort on a given array. arr = [5, 1, 6, 2, 4, 3]
codefeedback
Create a SQL query to select customers who have spent more than $1000 in the last month.
codefeedback
Use JavaScript to find the area of a circle with a radius of 7.
codefeedback
Given a list of string objects, write an SQL query to concatenate all the strings into a single string ['Hello', 'World', '!']
codefeedback
Given an array of numbers, write a prototype JavaScript function to find the average value of all numbers in the array [6, 5, 8, 10]
codefeedback
Parse the given HTML string into a readable JSON object. <html> <body> <h1>Hello World!</h1> </body> </html>
codefeedback
Calculate the number of minutes in 3 hours using Python.
codefeedback
Explain serverside rendering in web development.
codefeedback
Create a function that sorts a given list of strings alphabetically.
codefeedback
Create a list comprehension expression to generate a list of the squares of all even numbers from 1 to 10.
codefeedback
Create a PHP program to find the maximum of two numbers without using if...else or a comparison operator.
codefeedback
Design a physics experiment to measure the acceleration due to gravity,
codefeedback
Convert the given numerical value from base 10 to base 2. Number: 50
codefeedback
Calculate the area of a triangle given three side lengths.
codefeedback
Create a function to generate random English sentences. <noinputn>
codefeedback
Create a range between 10 and 20 with a step of 2.
codefeedback
Interpret the following regular expression. \d{2}\s[A-Z]{3}
codefeedback
Calculate the inverse of this matrix. [[1, 0, 0], [2, 1, 0], [4, 4, 4]]
codefeedback
Using random module, generate a random sequence of 8 numbers from range 1 to 8.
codefeedback
Generate a random string of length n containing only lowercase letters.
codefeedback
Generate a program to filter a list of numbers, passing only the greater than a given number list = [12, 24, 36, 45], 36
codefeedback
Write a function to extract the substring between two given indices of a string string = "Hello World", start_index = 2, end_index = 5
codefeedback
Using the Java programming language, print out the direct children of a given element in an HTML document. <div id="container"> <p>This is a paragraph.</p> <ul> <li>This is a list item.</li> <li>This is a second list item.</li> </ul> </div>
codefeedback
Write a SQL query to get the products with the lowest price in each category.
codefeedback
Using the PHP programming language, write a function to check if a string contains all vowels.
codefeedback
Choose a suitable data structure for finding the minimum and maximum element from a collection of numbers.
codefeedback
Compute the factorial of a given number using a recursive algorithm.
codefeedback
How does a hash table work?
codefeedback
Write a code that takes a list of strings and a string, and returns a list containing all strings from the given list that have the given string as a substring. ['Hello', 'Hello, world', 'Bonjour', 'My name is John'] String: 'lo'
codefeedback
Create a program in python that takes a number as input and checks if it is a prime number 5
codefeedback
Write a code that takes an array and returns an array of all elements in the original except for the duplicates. [1, 2, 2, 3, 4, 4, 5]
codefeedback
Generate a random password with 8 characters, including upper and lower case letters, numbers, and special characters.
codefeedback
Create a 3D scatterplot in Python to visualize 3 different datasets.
codefeedback
Train a sentiment analysis model using a corpus of movie reviews.
codefeedback
Create a Haskell function that takes a list of tuples and prints out the first element of each tuple.
codefeedback
In MongoDB, what does the command 'db.collection.aggregate()' do?
codefeedback
Write a regular expression in Ruby that prints all the words beginning with 'a' in a string. String: "The quick brown fox jumps over the lazy dog"
codefeedback
Write a code to get the top 5 Twitter trends in the US.
codefeedback
Write a regex to match the email address format.
codefeedback
Write a list comprehension to generate a list of all prime numbers less than 100. [noinput]
codefeedback
Write a C++ function that generates a Fibonacci series of numbers up to an integer n. n = 8
codefeedback
Design a CSS template for a website.
codefeedback
Create a new string from the given string by replacing any character with its opposite. string = "Hello"
codefeedback
Complete the function below to make a list of n numbers and return the result. n = 5
codefeedback
Define an application programming interface (API) for a given program.
codefeedback
Construct a custom data type that is capable of representing the information of a student in a college.
codefeedback
Suggest a suitable algorithm for sorting an array of numbers in increasing order.
codefeedback
What is the data type returned by the following code snippet? value = 2**8
codefeedback
Write a Python program to display even numbers between two intervals.
codefeedback
Given a list of words, write a Python program to find all pairs of distinct indices (i, j) in the given list, so that the concatenation of the two words, i.e. words[i] + words[j] is a palindrome. words = ["abcd", "dcba", "lls", "s", "sssll"]
codefeedback
Using binary search, find the index of a given number in an array of length n.
codefeedback