text stringlengths 141 2.89k ⌀ | instruction stringlengths 19 1.5k ⌀ | input stringlengths 0 800 ⌀ | output stringlengths 1 2.5k ⌀ |
|---|---|---|---|
[DE Wikipedia] Karakurt (Ukraine)
Karakurt (, , oder auch Karakurti, ) ist ein im Budschak gelegenes Dorf im Südwesten der ukrainischen Oblast Odessa mit etwa 2700 Einwohnern (2001). Geschichte Karakurt wurde 1811 als erste Siedlung von Albanern aus der bulgarischen Dobrudscha im Gouvernement Bessarabien des Russische... | null | null | null |
null | Create a database table in SQL. | Table Name: User Columns: user_id, username, password | CREATE TABLE User ( user_id INT NOT NULL, username VARCHAR(50) NOT NULL, password VARCHAR (50) NOT NULL, PRIMARY KEY(user_id) ); |
null | Generate a Python program to generate a list comprehension of a given set or range. | words = ["tea", "eat", "apple"] | result = [i[::-1] for i in words] |
null | Create a python package to analyze log data from a web server. The package should parse log entries and identify the top 10 most visited URLs on a daily basis. | sample.log
[2020-06-03 00:12:30] 192.168.0.1 GET /images/index.jpg 200
[2020-06-03 00:15:20] 192.168.0.2 GET /css/style.css 200
[2020-06-03 00:20:17] 192.168.0.2 GET /js/app.js 200
[2020-06-04 00:14:40] 192.168.0.1 GET /images/index.jpg 200
[2020-06-04 00:17:30] 192.168.0.2 GET /css/style.css 200
[2020-06-04 00... | import re
from collections import Counter
def read_logs(log_file):
log_entries = []
with open(log_file) as f:
lines = f.readlines()
for line in lines:
log_entry = line.strip().split(' ')
log_entries.append(log_entry)
return log_entries
def find_top_urls(log_file, day):
log_entries = read_logs(log_file)
urls ... |
null | Edit a Python program to take input from a user. | def hello():
print('Hello') | def hello():
name = input('What is your name? ')
print(f'Hello {name}') |
[HI Wikipedia] भारतीय अमरीकी
अमरीका में बसे 38,52,293 भारतीय अमेरिकी भारत और अमेरिका के मध्य मजबूत कड़ी हैं। सैन फ़्रांसिस्को-लॉस एंजेलिस, न्यूयॉर्क-न्यू जर्सी, शिकागो, डैट्रायट, ह्यूस्टन, एटलांटा, मायामी-आरलैण्डो-टैम्पा और वाशिंगटन डी. सी. के बड़े क्षेत्र में उनकी उल्लेखनीय उपस्थिति है। 1960 और 1970 के दशकों में अमेर... | null | null | null |
null | Develop a function in Python which reverses any given string. | def reverseString(str):
return str[::-1] | |
null | In JavaScript, create a function that returns the length of a string. | function stringLength(str){ return str.length; } | |
[EN Wikipedia] Algibacter
Algibacter is a genus in the phylum Bacteroidota (Bacteria). Etymology The name Algibacter derives from:Latin feminine gender noun alga, seaweed; Neo-Latin masculine gender noun, a rodbacter, nominally meaning "a rod", but in effect meaning a bacterium, rod; Neo-Latin masculine gender noun Al... | null | null | null |
null | explain the concept of static variables in a programming language | Static variables are variables which retain their value over multiple function calls. They are declared with the "static" keyword and can be accessed within the same scope in which they were declared. Static variables can be declared at the class level or at the function level and are typically used to maintain some st... | |
null | Write a Python program to find the nearest 3 squares to a given number. | 30 | def findNearestSquares(n):
nearestSquareList = []
i = 1
# Find all the nearest squares
while i * i <= n:
nearestSquareList.append(i * i)
i += 1
# Find the nearest 3 squares
nearest3Squares = nearestSquareList[-3:]
return nearest3Squares
nearest3Squares = findNearestSquares(30)
print(nearest... |
null | Rewrite the following code segment in C#. for (i = 0; i < n; i++) { j = j + i; } | int j = 0; for (int i = 0; i < n; i++) { j += i; } | |
[DE Wikipedia] Centre for the Resolution of the Emergency Situation
Centre for the Resolution of the Emergency Situation (kurz CRES; Thai: , RTGS: Sun Amnuai Kan Kae Khai Sathannakan Chuk Choen, kurz , deutsch: Zentrum für die Lösung der Notsituation) war eine thailändische Regierungsorganisation. Die Regierung Abhisi... | null | null | null |
[CS Wikipedia] Vteřina
Vteřina, plným názvem úhlová vteřina (dříve také oblouková vteřina), je jednou z jednotek úhlu (1/60 úhlové minuty). Pro úhlovou vteřinu se používá značka ″ (před kterou se nepíše mezera) či zkratka as. Stejná značka se používá i pro palec, což ale také není jednotka SI. Odlišení od jednotky čas... | null | null | null |
null | Create a HTTP GET request using Python. | import requests url = 'https://www.example.com' response = requests.get(url) print(response.text) | |
null | Write a Python code to update the values in a table. | Table name: orders
Table Schema:
order_id INT
customer_name VARCHAR
price INT
Input Data:
order_id = 2345
customer_name = ‘John Smith'
price = 59.99 | cur.execute("UPDATE orders SET customer_name = %s, price = %s WHERE order_id = %s", (customer_name, price, order_id))
conn.commit() |
null | Optimize a Python program to print the sum of the 10 smallest even numbers larger than a user-defined number. | num = 20 | num = int(input("Enter a number: "))
# Find the 10 smallest even numbers larger than the user-defined number
numbers = []
total = 0
for i in range(num+1, num+21):
if i%2 == 0:
numbers.append(i)
total += i
print('The sum is', total) |
[DE Wikipedia] Evangelische Kirche Grävenwiesbach
Die Evangelische Kirche Grävenwiesbach ist eine Dorfkirche in der Gemeinde Grävenwiesbach im Hochtaunuskreis. Sie steht unter Denkmalschutz. Lage und Nutzung Die Evangelische Kirche Grävenwiesbach, Kirchgasse 3, wird von der gleichnamigen Kirchengemeinde und für die ih... | null | null | null |
null | Write a Python program that reads a text document and performs tokenization followed by part-of-speech (POS) tagging. | text.txt
The quick brown fox jumps over the lazy dog. | import nltk
def tokenize_and_tag(filename):
tokens = nltk.word_tokenize(open(filename).read())
tagged_tokens = nltk.pos_tag(tokens)
print(tagged_tokens)
tokenize_and_tag('text.txt')
# Output: [('The', 'DT'), ('quick', 'JJ'), ('brown', 'NN'), ('fox', 'NN'), ('jumps', 'VBZ'), ('over', 'IN'), ('the', 'DT'), ('lazy',... |
null | Create an SQL query to select only the rows from a table where the second column is not empty. | SELECT * FROM TABLE_NAME WHERE COL2 <> ''; | |
null | Write a function in Python that takes a sentence and removes all spaces. | "Hello, World!" | def remove_spaces(sentence): """Remove all spaces from a given sentence.""" return sentence.replace(" ", "") |
null | Write code in Java to create a linked list. | class Node{ int data; Node next; Node(int d){ data = d; next = null; } } class LinkedList{ Node head; public void insert(int data){ Node node = new Node(data); if (head == null) { head = node; } else { Node n = head; while (n.next != null) { n = n.next; } n.next = node; } } } | |
null | Write an SQL query to get the name, age and salary of the youngest employee. | SELECT Name, Age, Salary FROM employees ORDER BY Age ASC LIMIT 1; | |
[EN Wikipedia] Semblis
Semblis is a genus of insects belonging to the family Phryganeidae. Species: Semblis atrata Semblis phalaenoides References Phryganeidae Trichoptera genera | null | null | null |
null | Translate the given program from Python to C. | def calculate_area(r):
pi = 3.14
area = pi * r * r
return area | #include<stdio.h>
#define PI 3.14
float calculate_area(float r)
{
float area = PI * r * r;
return area;
} |
null | In Python, create a loop that takes a user input and appends it to a list until the user types "stop". | my_list = []
while True:
user_input = input('Type something: ')
if user_input == 'stop':
break
my_list.append(user_input)
print(my_list) | |
[DE Wikipedia] Bremner-Gletscher
Der Bremner-Gletscher ist ein Gletscher in den Chugach Mountains in Südzentral-Alaska. Der Gletscher besitzt drei Gletscherzungen. Sein Nährgebiet liegt auf einer Höhe von an der Nordflanke des Mount Hawkins, einem östlichen Nebengipfel des Mount Tom White. Er strömt anfangs 16 km in n... | null | null | null |
[HI Wikipedia] ऊसर
ऊसर या बंजर (barren land) वह भूमि है जिसमें लवणों की अधिकता हो, (विशेषत: सोडियम लवणों की अधिकता हो)। ऐसी भूमि में कुछ नहीं अथवा बहुत कम उत्पादन होता है। ऊसर बनने के कारण जल भराव अथवा जल निकास की समुचित व्यवस्था का न होना वर्षा कम तापमान का अधिक होना भूमिगत जल का ऊंचा होना गहरी क्षेत्रों में जल रिसाव... | null | null | null |
null | Implement a Go program that takes a string as input and prints its reverse. | package main import "fmt" func main() { var str string fmt.Printf("Enter a string: ") fmt.Scanf("%s\n", &str) fmt.Printf("The reverse of the string is %s\n", reverse(str)) } func reverse(s string) string { r := []rune(s) for i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 { r[i], r[j] = r[j], r[i] } return string(r)... | |
null | Create an application in Python that displays the lyrics to a given song. | ‘Happy’ by Pharrell Williams | import requests
import re
def get_lyrics(song):
song = song.replace(" ", "+")
base_url = 'https://www.azlyrics.com/lyrics/'
page_url = base_url + song + ".html"
response = requests.get(page_url)
lyrics = re.search(r"<!-- start of lyrics -->(.*)<!-- end of lyrics -->", response.text, flags=re.DOTALL).group(1)
... |
null | Change the following list of strings into a single combined string. | my_list = ["Hello", "world", "this", "is", "a", "test"] | # Create the string from the list my_string = ' '.join(map(str, my_list)) # Print the string print(my_string) # Hello world this is a test |
null | Create a web page using HTML, CSS and JavaScript that displays a user's full name. | const fullName = "John Doe"; | <!DOCTYPE html> <html> <head> <title>My First Webpage</title> </head> <body> <h1>My Full Name</h1> <p>My full name is <span id="name">John Doe</span>.</p> <script> const fullName = "John Doe"; document.getElementById('name').innerHTML = fullName; </script> </body> </html> |
null | Compare two values to check if the first one is greater than the second one, and if so, print "A is greater than B". | A = 5 B = 3 | if A > B: print("A is greater than B") |
null | Write a PHP function named "calculateArea" to calculate the area of a rectangle. | length = 10 width = 20 | <?php function calculateArea($length,$width){ return $length * $width; } echo calculateArea(10,20); ?> |
null | Create an R function which takes a vector of numbers as input and returns its average. | getAvg <- function(x){ return(mean(x)) } | |
null | Create a function that adds two matrices of the same size. | [[1, 2], [3, 4]], [[5, 6], [7, 8]] | int[][] addMatrix(int[][] a, int[][] b) { int[][] c = new int[a.length][a[0].length]; for (int i = 0; i < a.length; i++) { for (int j = 0; j < a[i].length; j++) { c[i][j] = a[i][j] + b[i][j]; } } return c; } |
null | Generate an array of Nth Fibonacci sequence using Python. | N = 10 | def generate_fibonacci_sequence(N):
'''
This program takes in an integer N and returns the first N elements of the Fibonacci sequence
'''
fibonacci_sequence = []
if N < 1:
return fibonacci_sequence
elif N == 1:
fibonacci_sequence = [1]
return fibonacci_sequence
... |
null | Build a text generator in Python that can generate poem based on a given input. | def generate_poem(input):
poem = []
for i in range(len(input)):
line = ''
for j in range(i):
line += input[j] + ' '
poem.append(line)
return poem | |
[DE Wikipedia] Blindstock
Als Blindstock oder Montagezarge wird ein Rahmen bezeichnet, der als Lehrgerüst für Tür- und Fenster-Öffnungen in den Rohbau eingefügt wird. Typischerweise wird ein Blindstock aus Bohlen oder Kanthölzern gefertigt und kann nach Fertigstellung des Rohbaus dazu dienen, das Türfutter (Umfassungs... | null | null | null |
null | Write a Python program to search a database and generate a report based on the results. | The database contains information on employee records including name, salary, and department. | import sqlite3
# Connect Database
conn = sqlite3.connect('employee_records.db')
# Create Cursor
cursor = conn.cursor()
# Query Database
cursor.execute("SELECT name, salary, department FROM employees")
rows = cursor.fetchall()
# Generate Report
for row in rows:
name = row[0]
salary = row[1]
department = row[2]
p... |
null | Implement a web service using Python Flask to generate a pie chart from input data. | Sample input data: [1, 2, 4, 6] | import flask
from flask import request, jsonify
import matplotlib.pyplot as plt
# create the Flask app
app = flask.Flask(__name__)
app.config["DEBUG"] = True
# function to generate the pie chart
def generate_pie_chart(data):
fig, ax = plt.subplots()
ax.pie(data, labels=['1', '2', '4', '6'], autopct='%1.1f%%')
ax.a... |
null | Assign a value of 123 to the variable x. | x = 123 | |
null | Design a Python program to implement the Bubble Sort algorithm. | [1, 8, 4, 6, 2, 5] | def bubble_sort(arr):
for i in range(len(arr) - 1):
for j in range(len(arr) - i - 1):
if arr[j] > arr[j + 1]:
arr[j], arr[j + 1] = arr[j + 1], arr[j]
return arr
result = bubble_sort([1, 8, 4, 6, 2, 5])
print(result) |
null | Create a program that takes in two lists and prints out a new list with the elements from the first list followed by the elements from the second list. | list_1 = [1, 2, 3] list_2 = [4, 5, 6] | # define a function to combine two lists into one def combine_lists(list_1, list_2): # create a new list combined_list = [] # append the elements from list 1 for ele in list_1: combined_list.append(ele) # append the elements from list 2 for ele in list_2: combined_list.append(ele) # return the combined list return comb... |
null | Design an algorithm in Python to optimize a given set of objects for a given goal. | Objects: A, B, C, D
Goal: Maximize value | def optimize(objects, goal):
max_value = -float("inf")
best_config = None
for config in generate_configs(objects):
value = evaluate_config(config)
if value > max_value:
max_value = value
best_config = config
return best_config
def generate_configs(objects):
# Generate all possible combinations of th... |
null | Generate the Python code for a pipelie of KMeans and GaussianMixture clustering models. | n_clusters = 10 | from sklearn.cluster import KMeans, GaussianMixture
cluster = KMeans(n_clusters=n_clusters).fit(X)
pipeline = GaussianMixture(n_components=2).fit(cluster.cluster_centers_) |
null | Using the given information, create a SQL query to find the total number of products in the database. | Table: products Columns: product_id, product_name | SELECT COUNT(*) FROM products; |
null | Create a Python script to download a zip archive from a URL and extract it in the current directory. | https://example.com/myzip.zip | import requests
import shutil
import zipfile
url = 'https://example.com/myzip.zip'
response = requests.get(url, stream=True)
with open('myzip.zip', 'wb') as f:
shutil.copyfileobj(response.raw, f)
with zipfile.ZipFile('myzip.zip', 'r') as f:
f.extractall() |
null | Create a HTML page with a textbox, button and a message “Hello World!” | <html> <head></head> <body> <input type="text" id="textbox"> <button onclick="sayHello()">Say Hello</button> <p id="message">Hello World!</p> <script> function sayHello() { var text = document.getElementById('textbox').value; document.getElementById('message').innerHTML = "Hello " + text + "!"; } </script> </body> </ht... | |
null | Write an operation that adds all the numbers in a given list. | [32, 15, 45, 56, 16] | sum = 164 |
null | Write a SQL query to calculate the total cost of a given product. | product_id: 123 price: 100.50 quantity: 10 | SELECT SUM(price * quantity) AS total_cost FROM products WHERE product_id = 123; |
null | Create a Python class with the same content as a JSON string. | myjson_string = '{"name": "John", "age": 20}' | import json class Person: def __init__(self, json_string): data = json.loads(json_string) self.name = data['name'] self.age = data['age'] myjson_string = '{"name": "John", "age": 20}' person = Person(myjson_string) print(person.name, person.age) |
null | Generate a Python script to create a list of numbers in the range 0-n (inclusive) and print it. | n = 10 | n = 10
list_numbers = []
for i in range(0,n+1):
list_numbers.append(i)
print(list_numbers) |
null | Using regex, convert a string of dates from the format 'dd/mm/yyyy' to 'mm/dd/yyyy' | String "05/06/2019, 10/08/2020" | String "06/05/2019, 08/10/2020" |
null | Design a Python program to simulate a simple calculator. | #Function to add two numbers
def add(val1, val2):
return val1+val2
#Function to subtract two numbers
def subtract(val1, val2):
return val1-val2
#Function to multiply two numbers
def multiply(val1, val2):
return val1*val2
#Function to divide two numbers
def divide(val1, val2):
return val1/val2
while ... | |
null | Write a piece of code in Python that prints a multiplication table | def multiplication_table(n): for i in range(1, n+1): for j in range(1, n+1): print("{}x{}={}".format(i, j, i*j)) print("") | |
null | Convert the following code into equivalent Python 3 function. | function doubleString(str) {
return str + str;
} | def doubleString(str):
return str + str |
null | Generate a valid CSS rule to center align the text with the id "heading_text" | #heading_text { text-align: center; } | |
null | Create a Python script that splits a given string into equal parts | def split_str(str, n):
return [str[i:i+n] for i in range(0, len(str), n)] | |
null | Write a Python function to compute the total amount of a given grocery bill after taxes. | items = [('apple', 1.49), ('banana', 0.99), ('bread', 4.99)] | def compute_total_after_taxes(items): tax = 0.07 total = 0 for item in items: price = item[1] tax_amount = price * tax total += price + tax_amount return round(total, 2) |
null | Write a Python script that takes in the arguments x and y and prints the result of p + q. | p = 5
q = 7 | def calculate_sum(x, y):
"""
Takes in the arguments x and y and prints the result of p + q.
Args:
x: first argument.
y: second argument.
Returns:
result: the sum of the two arguments.
"""
result = x + y
return result
p = 5
q = 7
result = calculate_sum(p, q)
print(res... |
null | Create an expression parser in Python to evaluate basic mathematical expressions. | # Assume input is a valid mathematical expression with no syntax errors
def expression_parser(expression):
tokens = expression.split()
stack = []
for token in tokens:
if token == '+' or token == '*' or token == '/':
a = stack.pop()
b = stack.pop()
if t... | |
null | Construct a regex pattern in Python to match any odd number. | import re
pattern = re.compile('[13579]') # matches any odd number | |
null | Create an array of objects in JavaScript that contains five objects, each representing a different programming language. | var languages = [ {langName: "JavaScript", creator: "Brendan Eich", releaseYear: 1995}, {langName: "Python", creator: "Guido van Rossum", releaseYear: 1991}, {langName: "C", creator: "Dennis Ritchie", releaseYear: 1972}, {langName: "Java", creator: "James Gosling", releaseYear: 1995}, {langName: "C++", creator: "Bjarne... | |
null | Construct a Python program that finds the maximum number in a given sequence of integers. | 7, 3, 12, 9, 4 | sequence = [7, 3, 12, 9, 4]
maxnum = 0
for num in sequence:
if num > maxnum:
maxnum = num
print(maxnum) # Output: 12 |
null | Create a function in JavaScript to convert a given string to a positive integer. | str = "323" | const convertStringToInteger = str => { return parseInt(str, 10); } |
null | Construct an SQL query that averages the grades of students belonging to the Physics department. | Table Name: Grades | SELECT AVG(grade) FROM Grades WHERE department = 'Physics'; |
null | Create a web scraper to extract the title and description of a given URL using BeautifulSoup. | URL: https://www.example.com/ | # Imports import requests from bs4 import BeautifulSoup # Define the URL url = "https://www.example.com/" # Get the HTML response = requests.get(url) html = response.content # Parse the HTML soup = BeautifulSoup(html,"html.parser") # Extract the title and description title = soup.find("title").text description = soup.f... |
null | Where does a Python interpreter look for modules? | The Python interpreter looks for modules in the following locations: the home directory, the built-in modules, the PYTHONPATH environment variable, and the standard Python library path. | |
[EN Wikipedia] Hagenella
Hagenella is a genus of insects belonging to the family Phryganeidae. The species of this genus are found in Europe, Easternmost Asia and Northern America. Species: Hagenella apicalis (Matsumura, 1904) Hagenella canadensis (Banks, 1907) References Phryganeidae Trichoptera genera | null | null | null |
[HI Wikipedia] भगवानबाबा
आबाजी तुबाजी सानप (२९ जुलाई १८९६ - १८ जनवरी १९६५) जो 'भगवानबाबा' के नाम से प्रसिद्ध थे, उनका जनमः सावरगाव घाट तालुका पाटोदा जिल्हा बीड में हुवा था। । महाराष्ट्र के वारकरी सम्प्रदाय के प्रसिद्ध सन्त थे। परिचय भगवानबाबा हिंदुओं के गौरव हैं। जिस दौर में हिंदू धर्म और संस्कृति पर आक्रमण हो रहे थे ... | null | null | null |
null | Design a function in JavaScript to take in two strings as parameters and return true if the strings are anagrams and false otherwise. | function isAnagram(string1, string2) { // Convert both strings to lowercase var s1 = string1.toLowerCase(); var s2 = string2.toLowerCase(); // To sort the strings and // remove all spaces s1 = s1.replace(/ /g, '').split('').sort().join(''); s2 = s2.replace(/ /g, '').split('').sort().join(''); if (s1 == s2) return true;... | |
null | Design a function to validate a phone number. | Phone Number: 212-555-0000 | def check_phone_number(phone_number): #Remove any non-numeric characters phone_number = phone_number.replace("-", "") phone_number = phone_number.replace(" ", "") #Check if the phone number is 10 digits long if (len(phone_number) != 10): return False #Check each digit is a number for digit in phone_number: if not digit... |
[EN Wikipedia] Simon Edens
Simon Edens, QGM, QPM, was a career police officer within the United Kingdom and is a former Chief Constable of Northamptonshire Police. Career History Simon started his policing career with the Royal Ulster Constabulary (now the Police Service of Northern Ireland). Between 1981 and 1991, Si... | null | null | null |
null | Produce a JavaScript code snippet for opening a new browser window. | window.open("", "_blank"); | |
[DE Wikipedia] Progressive Jazz
Progressive Jazz ist ein vermeintlicher Jazzstil der späten 1940er- und frühen 1950er-Jahre. Dieses Etikett hat erstmals Stan Kenton verwendet, um Aspekte seines eigenen Schaffens zu beschreiben. Er konnte hierbei insbesondere auf Pete Rugolo, Robert Graettinger, Chico O’Farrill oder Fr... | null | null | null |
[EN Wikipedia] Boris P. Stoicheff
Boris P. Stoicheff, , (June 1, 1924 – April 15, 2010) was a Macedonian Canadian physicist. Stoicheff was born in Bitola, in the Kingdom of Yugoslavia (present-day North Macedonia). His family emigrated to Canada 1931, and he grew up in Toronto. He earned a degree in Engineering Physic... | null | null | null |
null | Implement a Python method that builds a binary search tree from an unsorted array | [4, 3, 8, 15, 1, 5] | # Node class
class Node:
def __init__(self, val):
self.val = val
self.left = None
self.right = None
# Function to construct a Binary Search Tree
# from a given array
def constructBst(arr):
# check if list is empty or not
if (len(arr) == 0):
return None
# create... |
[EN Wikipedia] Pavelló de l'Espanya Industrial
The Pavelló de l'Espanya Industrial (), currently named Centre Esportiu Municipal l'Espanya Industrial is a building located in Barcelona. Completed in 1991, it hosted the weightlifting competitions for the 1992 Summer Olympics. References 1992 Summer Olympics official re... | null | null | null |
null | What is a for loop? | A for loop is a programming structure used to repeat a specific set of instructions for a given number of times or until a specified condition is met. The syntax of a for loop is "for <variable> in <sequence>:" and the format is "for <variable> in range(<start_value>, <end_value>):" where the start and end value are op... | |
[CS Wikipedia] Evropský systém ostrahy hranic
Evropský systém ostrahy hranic (zkratka Eurosur z anglického The European Border Surveillance System) je monitorovací systém Evropské unie, který využívá drony, průzkumná letadla, pobřežní čidla a dálkový průzkum pomocí satelitů ke sledování nelegální imigrace do členských... | null | null | null |
[EN Wikipedia] Cozzolino
Cozzolino is an Italian surname. Notable people with the surname include: Andrea Cozzolino (born 1962), Italian politician Dominic Cozzolino (born 1994), Canadian ice sledge hockey player Giuseppe Cozzolino (born 1985), Italian footballer Kei Cozzolino (born 1987), Japanese-born Italian racing... | null | null | null |
null | Generate a random number between 5 and 10 using Python. | import random
rand_num = random.randint(5,10)
print(rand_num) | |
null | What is the syntax required to create an array of objects using JavaScript? | An array of objects can be created using the syntax below: let arrayOfObjects = [ { key1: 'value1', key2: 'value2' }, { key1: 'value3', key2: 'value4' }, { key1: 'value5', key2: 'value6' } ]; | |
null | Develop a code that can calculate the cumulative sum of an array | [2, 4, 6, 8, 10] | def cummulative_sum(arr): cum_sum = 0 for num in arr: cum_sum += num return cum_sum if __name__ == '__main__': test_list = [2, 4, 6, 8, 10] print('Cumulative Sum:', cummulative_sum(test_list)) |
null | Develop a Python function to calculate the summed weighted average from a given set of values and weight. | values = [90, 50, 70], weights = [0.4, 0.2, 0.4] | def weightedAverage(values, weights):
sum = 0.0
for i in range(len(values)):
sum += values[i] * weights[i]
return sum/len(values)
values = [90, 50, 70]
weights = [0.4, 0.2, 0.4]
print(weightedAverage(values, weights)) |
null | Create an API in Python and deploy it with the Flask framework | # import dependencies
import flask
from flask import request, jsonify
#import API methods
import some_function
app = flask.Flask(__name__)
app.config["DEBUG"] = True
# create API endpoint
@app.route('/api', methods=['GET'])
def api_call():
# Get the query parameters
query_parameters = request.args
# C... | |
null | Create a basic log in security system in Java | boolean checkLogin(String username, String password) { boolean success = false; if(username.equals("admin") && password.equals("admin")) { success = true; } return success; } | |
null | Implement an RSA encryption algorithm in Python. | # generate a random prime number
def gen_prime():
# generate a large, prime number
p = getPrime(1024)
q = getPrime(1024)
# compute the modulus
n = p * q
return n
# generate the private and public key
def gen_keys(n):
# generate two distinct large primes
p = getPrime(1024)
q = ... | |
null | Suggest a machine learning model for predicting stock prices. | A possible machine learning model for predicting stock prices is the Long Short-Term Memory (LSTM) Neural Network. This model is widely used for forecasting time-series data, such as stock prices. It is capable of capturing long-term dependencies and has been used successfully to make accurate predictions in many areas... | |
null | Write a C program to implement diamond pattern. | #include <stdio.h> int main() { int n; //number of rows //to be printed printf("Enter the number of rows\n"); scanf("%d",&n); // odd number of rows if(n%2==1) { // rows increment for(int i=0; i<n; i++) { // Print spaces for(int j=0; j<n-i-1; j++) { printf(" "); } // Print stars for(int k=0; k<2*i+1; k++) { printf("*");... | |
null | Create a jQuery function to detect when a page is scrolled. | $(window).scroll(function() { console.log('Scroll detected'); }); | |
null | Create a python class with setter and getter methods. | class Person:
def __init__(self, name, age):
self.name = name
self.age = age
def get_name(self):
return self.name
def get_age(self):
return self.age
def set_name(self, name):
self.name = name
def set_age(self, age):
self.age = age | |
[CS Wikipedia] Monoklonální protilátka
Monoklonální protilátka (MoAb) je protilátka (imunoglobulin), která je získaná z klonální populace jedné plazmatické buňky. Každá plazmatická buňka (ve skutečnosti vlastně aktivovaný B-lymfocyt) v těle je schopná produkovat jistou variantu imunoglobulinu a těchto variant je obrov... | null | null | null |
[CS Wikipedia] Ari Ólafsson
Ari Ólafsson (* 21. května 1998, Reykjavík, Island) je islandský zpěvák. S písní Our Choice reprezentoval Island na Eurovision Song Contest 2018 v Lisabonu. V semifinále skončil na posledním 19. místě s 15 body, od diváků neobdržel ani jeden bod. Život a kariéra Počátky Ari se zpěvu věnuje ... | null | null | null |
null | Create a Python class that accepts a name and an age to create a person instance. | class Person: def __init__(self, name, age): self.name = name self.age = age def __str__(self): return f'Name: {self.name}, Age: {self.age}' | |
[EN Wikipedia] Global Enabling Trade Report
The Global Enabling Trade Report was first published in 2008 by the World Economic Forum. The 2008 report covers 118 major and emerging economies. At the core of the report is the Enabling Trade Index which ranks the countries using data from different sources (e.g., World E... | null | null | null |
null | Create a Python program to display the prime numbers between 1 and 10. | """
Create a Python program to display the prime numbers between 1 and 10
"""
#Function to check if a number is prime
def is_prime(n):
for i in range(2, n): #Check the number between 2 and n
if n % i == 0: #If the number is divisible by any other number in that range
return False
return T... | |
null | Create an API in Python with Flask for an online store. The API should include endpoints to list items, get items by id, add items, update items, and delete items. | Not Applicable | from flask import Flask, jsonify, request
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////tmp/test.db'
db = SQLAlchemy(app)
class Item(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(50))
description = db.Column(db... |
null | Update the given code to add a statement to check if the input number is a prime or not. | num = 5 | flag = 0 for i in range(2, num): if num % i == 0: flag = 1 if flag == 0: print("The number is a prime.") |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.