instruction_seed
stringlengths
0
26.4k
source
stringclasses
4 values
Train a model to classify text into two categories, positive and negative.
codefeedback
Using Java, build a program that will convert a given number from one base to another.
codefeedback
Suggest an algorithm in Python that will detect an anomaly in time-series data.
codefeedback
Why is using the+= operator more efficient than using a+=b on strings in Java?
codefeedback
Change the given array to a singly linked list without using a loop. array = [1, 2, 3, 4, 5]
codefeedback
Generate a code to reverse a string without using any loop. Input String = "Hello World!"
codefeedback
Write a function that returns the length of the longest common substring between two strings. s1 = 'abcde' s2 = 'abfghe'
codefeedback
Complete the following function to output a reversed string
codefeedback
Write a code to decrypt a given cipher text using the Caesar cipher cipher_text="dfwlrq"
codefeedback
Explain how the Naive Bayes classifier works.
codefeedback
Output the longest consecutive character string in a given string.
codefeedback
Create a function that takes a matrix (MxN array) and returns the transposed matrix.
codefeedback
Take an array of strings and a character and return an array containing only the strings containing the given character.
codefeedback
Scrape the results of a web page and extract all the names and emails.
codefeedback
Implement a sorting algorithm which takes an array of integers as input and sorts it in ascending order. [34, 19, 42, -9, 2018, 0, 105]
codefeedback
Generate a 10 character random user password with at least one Upper Case letter, one lower case letter, one number, and one special character.
codefeedback
Generate a 4 by 4 multiplication table.
codefeedback
Given an array of integers, find the longest subarray with total sum less than the given sum. arr = [1, -2, 2, 4, 3], sum = 3
codefeedback
Sort a given array in ascending order based on the second element of each array element pair. arr = [(3, 5), (4, 1), (1, 4), (2, 2)]
codefeedback
Write a SQL query to find the 10 longest surnames from a given table of surnames.
codefeedback
Create a function to check if the two strings can be made equal by replacing the letters with asterisks in the same order. String s1 = "aaabbcc"; String s2 = "a*a*b*c*";
codefeedback
Write a JavaScript program to parse and evaluate a simple mathematical expression entered as a string. String str = "2 + 3 * 4 - 5 / 3";
codefeedback
Calculate the total number of unique elements in this array. array = [[1, 1], [2, 2], [3, 3], [4, 4]]
codefeedback
Find the longest palindromic substring of this string. string = "carrace"
codefeedback
Flatten this nested list into a single list. nested_list = [[1,2], [3,4], [5,6]]
codefeedback
Generate all possible permutations of this list. my_list = [1, 2, 3]
codefeedback
Fix the following code so that it works without errors. ``` def remove_characters(name, characters): for c in characters: name.replace(c, '') return name name = "Alice" characters = ["A", "e"] ```
codefeedback
Write the code for a function that takes two parameters n and m and returns the sum of the first n odd integers starting with m.
codefeedback
Find the inverse of the given matrix [ [1, 2], [3, 4] ]
codefeedback
Write an assembly language program to generate a Fibonacci series with n number of elements.
codefeedback
Generate a Huffman code for a given set of symbols and probabilities Symbols: ['A', 'B', 'C', 'D'] Probabilities: [0.2, 0.3, 0.3, 0.2]
codefeedback
Suggest an optimisation algorithm for a minimisation problem
codefeedback
Count and return the number of lowercase and uppercase characters in a given string. my_str = "Hello World!"
codefeedback
Write a MongoDB query that retrieves the documents from the inventory collection where the quantity field is greater than 10.
codefeedback
Generate a Matrix with random integers between 1-50 and output the Matrix. rows = 5 columns = 6
codefeedback
Write a JavaScript function to convert the given 12-hour time format to 24-hour format. time = "12:05 PM"
codefeedback
Create a decision tree to classify if a given student's grade ranges from A to D.
codefeedback
Write an SQL query to find the name of customers who have ordered more than two items this month.
codefeedback
Construct a regular expression that matches a string containing numbers from 0 to 9 within a range of 8 and 16 digits.
codefeedback
Explain why software design patterns are important in software development.
codefeedback
Create a shell script to find the first ten prime numbers
codefeedback
Write a Java program to print all the Armstrong numbers between 100 to 500. An Armstrong number is a number that is equal to the sum of its own digits each raised to the power of the total number of digits.
codefeedback
Write a SQL query to group the records from a table named 'countries' by their population greater than 10 million.
codefeedback
Write a MySQL query to count the number of book titles in the 'books' table having the word 'the' in their title.
codefeedback
Write a Java code to create a thread and process the tasks in separate threads.
codefeedback
Write an SQL query to retrieve the employee’s name from a table with the employee’s id. employees (id, name, age)
codefeedback
Implement a C program which will check if user input is an integer number or not.
codefeedback
Write a Bash script which will retrieve system information, including memory, storage and IP address.
codefeedback
Create a React component that takes two props, a message and a color, and displays the message with the desired color.
codefeedback
Implement a function that returns the reversed version of a given string.
codefeedback
Create a Java method to interpret a given string into an integer.
codefeedback
Design a function which prints all the permutations of a given list of numbers.
codefeedback
Write a function in R that takes a vector as an argument and returns a new vector in which each element is the average of that element with its two neighbors from the original vector. c(1, 4, 2, 8, 6)
codefeedback
Create a regular expression pattern in JavaScript that checks if a given string is a valid mobile phone number in India.
codefeedback
Create a machine learning model in Python using the given data that classifies the data into either 'positive' or 'negative'. <contents of the dataset>, data type: binary classification
codefeedback
Create a web page using HTML and CSS where the font size of the content increases with the screen size.
codefeedback
Write a web scraper in Python to collect the data from the top 1000 IMDB movies
codefeedback
Debug the following function. def f(n): i = 0 while i < n: i+=1 if i % 5 == 0: print(i)
codefeedback
Construct an object-oriented code for a Book class.
codefeedback
Create an algorithm that can recognize handwriting.
codefeedback
Suggest a better algorithm for calculating Fibonacci sequence.
codefeedback
Write a generic code for traversing a tree.
codefeedback
Edit the following HTML code so that it displays a black, 100px border-radius circle. <div class="circle"></div>
codefeedback
Suggest a way of replacing all the vowels in a string with a star (*). string = "Hello World!"
codefeedback
Write a RabbitMQ consumer in Java to listen to a particular queue.
codefeedback
Print the maximum element in a linked list. head - [1, 3, 4, 10, 8]
codefeedback
Create a class that contains two methods: one to generate a random number between a given range, and one to create a list of "n" random numbers. n = 10, min = 0, max = 100
codefeedback
Calculate the sum of all the integers in the range of m to n (inclusive). m = 10, n = 20
codefeedback
Suggest an improvement to make the code more efficient. a = [1,2,3,4,5] loop_count = len(a) while loop_count > 0: print(loop_count) loop_count -= 1
codefeedback
Suggest a way to make the following code more concise. if i == 0: result = "zero" elif i == 1: result = "one" elif i == 2: result = "two"
codefeedback
Implement a class to implement a Huffman coding algorithm.
codefeedback
What is the workflow of a deep learning project?
codefeedback
Implement the bottom up cut rod algorithm in Python.
codefeedback
Describe the working of a Recurrent Neural Network (RNN).
codefeedback
Provide a function to implement a Binary Tree traversal.
codefeedback
Generate the Fibonacci sequence in a given range in Python. n = 8
codefeedback
Generate a random 9-digit id in Java.
codefeedback
Are string and array objects mutable or immutable in JavaScript?
codefeedback
Suggest a machine learning model for predicting stock prices.
codefeedback
Write CSS code to position a div in the middle and bottom of the page.
codefeedback
How would you design a game of hangman using object-oriented programming?
codefeedback
Generate a token based on the given parameters. Parameters: Algorithm (SHA-256), Size (32 characters), Encode (Hexadecimal)
codefeedback
Convert a given number from binary to hexadecimal using C programming language. 10101
codefeedback
In SQL, write an expression to output all valid email addresses from a table of users.
codefeedback
Convert the given hashmap ['name1': 'value1', 'name2': 'value2' ] to JSON.
codefeedback
Construct a while loop in order to traverse through an array.
codefeedback
Describe the process of writing a recursive program.
codefeedback
Generate a for-loop that prints out the square of the first 10 natural numbers.
codefeedback
Rewrite the following code snippet (written in Java), such that the same purpose is accomplished but with fewer lines of code. public static void printList(List<String> list) { for (int i = 0; i < list.size(); i++) { System.out.println(list.get(i)); } }
codefeedback
Write a Java code snippet to check whether or not a number is a prime.
codefeedback
Write a Python program to create a random string of size 10 consisting of alphabets and digits.
codefeedback
Write an SQL query to get all employee salaries whose salaries are more than 50000.
codefeedback
Write an SQL query to display the name of the employees and their managers.
codefeedback
Write a C# program to interchange the elements of the first and last columns of a given matrix. int[,] matrix = { { 11, 21, 31, 41 }, { 12, 22, 32, 42 }, { 13, 23, 33, 43 } };
codefeedback
Construct an SQL query to display the titles of movies with more than 10 awards.
codefeedback
Define a C++ function to calculate the volume of a sphere.
codefeedback
Write a query in SQL to retrieve the records that have the highest salary.
codefeedback
Convert a given JSON string to its Python dictionary equivalent. json_string = '{"name":"John","age":30}'
codefeedback
Parse the sentence and extract all the verbs from it. Sentence: "She ran quickly to catch the bus."
codefeedback
Generate a dictionary that contains all the words in a string of text, and the number of times each word occurs. Text: "I like dogs and cats and I like cats more than dogs"
codefeedback