text stringlengths 141 2.89k ⌀ | instruction stringlengths 19 1.5k ⌀ | input stringlengths 0 800 ⌀ | output stringlengths 1 2.5k ⌀ |
|---|---|---|---|
null | Create a web scraper in Python that extracts data from a given website. | Website URL: "https://www.example.com" | # Importing necessary modules
import requests
from bs4 import BeautifulSoup
# The URL to get data from
url = "https://www.example.com"
# Making a request to the website and getting the response
response = requests.get(url)
soup = BeautifulSoup(response.content, 'html.parser')
# Extracting the required data
data = so... |
null | Create a basic Java program that implements a binary search tree. | class BinarySearchTree { Node root; /* Class containing left and right child of current node and key value*/ class Node { int key; Node left, right; public Node(int item) { key = item; left = right = null; } } // Constructor BinarySearchTree() { root = null; } // This method mainly calls insertRec() void insert(int key... | |
null | Design a function in Java that takes in a string and returns true if the string contains the letter "a" and false otherwise. | public static boolean hasLetterA(String s){ return s.contains("a"); } | |
[HI Wikipedia] खोरठा भाषा
खोरठा (खोरथा या खोट्टा) एक ऐसी भाषा है जिसे भारतीय राज्य झारखंड में बोली जाता है , मुख्यतः दो डिवीजनों के 13 जिलों में: उतरी छोटानागपुर प्रमण्डल और संथाल परगना । खोरठा न केवल सदानों द्वारा बोली जाती है बल्कि आदिवासी द्वारा एक संपर्क भाषा के रूप में भी प्रयोग की जाती है। यह झारखंड की सबसे अधिक... | null | null | null |
[DE Wikipedia] Konstantinas Bogdanas
Konstantinas Bogdanas (* 4. Februar 1926 in Žeimiai, Bezirk Kėdainiai; † 26. September 2011 in Vilnius) war ein litauischer Bildhauer, Hochschullehrer und Ehrenbürger der Rajongemeinde Jonava. Leben Konstantinas Bogdanas ist im Gutshof Žeimiai geboren. Er lernte an der Grundschule ... | null | null | null |
null | Tell me how to print an IMDB movie rating using Python | import imdb # create an instance of the IMDb class ia = imdb.IMDb() # get the movie movie = ia.get_movie('tt0111161') # The Shawshank Redemption # get the rating rating = movie['rating'] # print the rating print(f"Rating for the movie 'The Shawshank Redemption': {rating}") | |
[CS Wikipedia] Hybnost
Hybnost je fyzikální veličina, která je mírou posuvného pohybu tělesa a je součinem jeho hmotnosti a rychlosti. Hybnost ve své podstatě popisuje pohybový stav tělesa. Hybnost je vektorová veličina, stejně jako rychlost, a má stejný směr. Hybnost tělesa je rovná impulzu síly, který je potřeba na ... | null | null | null |
null | You are given an array of integers and you need to find three numbers such that the sum of the three numbers is 0. | nums = [-40, 40, -20, 60, 10, -80] | // Use a brute-force approach to find the three numbers for (let i = 0; i < nums.length; i++) { for (let j = i+1; j < nums.length; j++) { for (let k = j+1; k < nums.length; k++) { if (nums[i] + nums[j] + nums[k] === 0) { console.log(nums[i], nums[j], nums[k]) } } } } // Output -40, 40, -80 |
[EN Wikipedia] Mike Imber
Michael John Imber (November 1940 – 28 April 2011) was a New Zealand ornithologist known for his research work and expertise on petrels. Imber completed a Master's thesis in 1965 at Massey University, on population density and reproduction in mice. Imber worked for the New Zealand Department ... | null | null | null |
[CS Wikipedia] Muzeum porcelánu v Klášterci nad Ohří
Muzeum porcelánu v Klášterci nad Ohří se nachází v budově kláštereckého zámku. U příležitosti 140. výročí založení thunské porcelánky zde roku 1954 byla instalována dlouhodobá expozice evropského, zvláště českého, porcelánu ze sbírek Uměleckoprůmyslového muzea v Pra... | null | null | null |
null | Write Python code to implement a class like this. | class Employee:
def __init__(self, name, age):
self.name = name
self.age = age | class Employee:
def __init__(self, name, age):
self.name = name
self.age = age
def __str__(self):
return "Employee({0}, {1})".format(self.name,self.age)
emp = Employee("John", 24)
print(emp) |
null | Design a Python script that converts Miles/hour to Kilometers/hour. | Speed in Miles/hour: 60 | def mph_to_kph(speed):
kph = speed * 1.609
return kph |
null | Write a Python loop that prints out a list of random numbers between 0 and 100. | Number of random numbers: 5 | import random
random_numbers = []
for i in range(5):
number = random.randint(0,100)
random_numbers.append(number)
print(random_numbers) |
null | Write a Python script to sort a given list of numbers in ascending order. | [3, 7, 1, 5, 4] | def sort_numbers_ascending(numbers): # Sort the list numbers.sort() return numbers # Driver code nums = [3, 7, 1, 5, 4] print(sort_numbers_ascending(nums)) |
null | Create a program in Python to calculate the average word length in a given title. | "The Cat in the Hat" | def calculate_average_word_length(title):
words = title.split()
total_length = 0
for word in words:
total_length += len(word)
return total_length / len(words)
result = calculate_average_word_length("The Cat in the Hat")
print(result) |
[CS Wikipedia] Julien Simon-Chautemps
Julien Simon-Chautemps (* 14. května 1978 Francie) je francouzský inženýr pracující pro tým formule 1 Sauber. Je absolventem Polytechnického ústavu vyšších věd. V roce 2007 začal pracovat pro týmy ve Formuli 1. V letech 2007–2010 byl závodním inženýrem v týmu Toyota a Lotus Jarna ... | null | null | null |
null | Construct a C++ code snippet to create a basic class named 'Person' with 2 fields: 'name' and 'age'. | class Person { string name; int age; public: Person(string n, int a) { name = n; age = a; } }; | |
null | Create a Python program that prints out the words in a sentence in reverse order. | I love programming. | def reverse_words(sentence):
words = sentence.split()
words.reverse()
return " ".join(words)
print(reverse_words("I love programming.")) |
null | Retrieve the company name from the following object | const user = { name: 'John Doe', company: 'Google' } | user.company |
[CS Wikipedia] Dániel Berzsenyi
Dániel Berzsenyi (7. května 1776, Egyházashetye – 24. února 1836, Nikla) byl maďarský básník. Život Byl luterán, pocházel ze starého šlechtického rodu. Celý život strávil na svém panství. Žil v Zadunají jako statkář a zároveň byl literárně činný. Ve své tvorbě usiloval o harmonické spoj... | null | null | null |
null | Write a Python program that takes in two lists and returns a merged list with unique elements. | list1 = [1, 2, 3]
list2 = [2, 3, 4] | list1 = [1, 2, 3]
list2 = [2, 3, 4]
merged_list = list(set(list1 + list2))
print(merged_list) #Output: [1, 2, 3, 4] |
null | Develop an algorithm in Python to compute the intersection of two lists. | list_a = [3, 5, 6, 9]
list_b = [4, 5, 8, 9] | def findIntersection(list_a, list_b):
intersection_list = []
for element in list_a:
if element in list_b:
intersection_list.append(element)
return intersection_list
# Main
list_a = [3, 5, 6, 9]
list_b = [4, 5, 8, 9]
intersection_list = findIntersection(list_a, list_b)
print('Intersection of list... |
[DE Wikipedia] Ankasa-Nini-Suhien-Nationalpark
Der Ankasa-Nini-Suhien-Nationalpark ist ein Nationalpark in Ghana mit einer Fläche von insgesamt etwa 510 km². Dieser Park ist in der Western Region an der Grenze zur Elfenbeinküste gelegen. Dieser Nationalpark zeichnet sich durch seinen insgesamt auf einer Fläche von 175... | null | null | null |
null | Create a program to detect the type of a given character. | def detect_char_type(ch): char_type = "" if ch.isalpha(): char_type = "Letter" elif ch.isdigit(): char_type = "Digit" elif ch.isspace(): char_type = "Space" elif ch in string.punctuation: char_type = "Punctuation" else: char_type = "Special Character" return char_type | |
[HI Wikipedia] ग़िज़र ज़िला
ग़िज़र पाक-अधिकृत कश्मीर के गिलगित-बलतिस्तान क्षेत्र का पश्चिमतम ज़िला है। इसकी राजधानी गाहकूच शहर है। यहाँ कई जातियाँ रहती हैं और तीन मुख्य भाषाएँ बोली जाती हैं - खोवार, शीना और बुरूशसकी। इनके अलावा इस ज़िले के इश्कोमन क्षेत्र में कुछ वाख़ी और ताजिक बोलने वाले भी यहाँ रहते हैं। कुछ गुज्जर... | null | null | null |
null | Using jQuery, design an effect to fade out an element when clicked on. | $(function() { $('#myElement').on('click', function(e) { $(this).fadeOut(300); }); }); | |
null | Generate a correct Python program to print out the sequence of numbers in ascending order from a given list. | [10, 5, 2, 8, 12] | for i in sorted([10, 5, 2, 8, 12]):
print(i) |
[CS Wikipedia] Lucas Hedges
Lucas Hedges (* 12. prosince 1996 New York) je americký herec, pocházející z Brooklynu. Proslavil se rolí Patricka Chandlera ve filmu Místo u moře, který byl nominován na Oscara, udělovaného americkou Akademií filmového umění a věd. Život Lucas Hedges se narodil v New Yorku, ve čtvrti Brook... | null | null | null |
[EN Wikipedia] Gmina Sanniki
Gmina Sanniki is a rural gmina (administrative district) in Gostynin County, Masovian Voivodeship, in east-central Poland. Its seat is the village of Sanniki, which lies approximately east of Gostynin and west of Warsaw. The gmina covers an area of , and as of 2006 its total population is ... | null | null | null |
null | Find all the multiples of a number in between two given numbers. | def find_multiples(base, lower, upper): output = [] for i in range(lower, upper+1): if i % base == 0: output.append(i) return output | |
[DE Wikipedia] Froreich
Froreich steht für: Froreich (Adelsgeschlecht), deutsch-baltisches, später pommersches Adelsgeschlecht Froreich ist der Familienname folgender Personen: Karl von Froreich (1790–1867), preußischer Generalmajor Ulrich Karl von Froreich (1739–1801), preußischer Generalmajor Wilhelm Leopold von Fro... | null | null | null |
null | Construct a decision tree classifier in Python, to classify an animal based on body characteristics. | Not applicable | from sklearn import tree
# features (characteristicsof animals)
# 0 for false, 1 for true
features = [[1, 0], [1, 1], [0, 1], [0, 0]]
# labels of features (types of animals)
labels = [0, 0, 1, 1]
# decision tree classifier
clf = tree.DecisionTreeClassifier()
# train the classifier with the data
clf = clf.fit(featur... |
[DE Wikipedia] Cat5
CAT5 steht für: CAT Testsystem 5 („Computer-assistiertes Testen“), fünfte Generation des durch den Psychologischen Dienst der Bundeswehr initiierten Testsystems zur computerunterstützten Psychodiagnostik Cat-5 steht für: Cat-5-Kabel, Kategorie 5 von Twisted-Pair-Kabeln zur Datenübertragung CAT5 | null | null | null |
null | Given an input sentence with 4 different words, create a python program that phrases each word with the same first letter. | Hello World Goodbye Mars | """
Given an input sentence with 4 different words, create a python program that phrases each word with the same first letter
"""
words = 'Hello World Goodbye Mars'.split()
for word in words:
print(word[0] + word[1:]) |
null | Create an AI game in Python for the user to guess a number between 1 and 10. | import random
# set the maximum number of guess
max_guesses = 5
# generate a random number
target_num = random.randint(1, 10)
# initialize number of guesses
num_guesses = 0
# prompt user for a guess
while num_guesses < max_guesses:
user_guess = int(input("Guess a number between 1 and 10: "))
# check if... | |
null | Given a string and a character, write a program that counts the number of occurrences of the character in the string. | string = 'Hello World!' character = 'l' | def count_occurrences(string, character): count = 0 for i in range(len(string)): if string[i] == character: count += 1 return count |
[EN Wikipedia] List of Israeli films of 1977
A list of films produced by the Israeli film industry in 1977. 1977 releases See also 1977 in Israel References External links Israeli films of 1977 at the Internet Movie Database Israeli Film 1977 | null | null | null |
[HI Wikipedia] ईरान का परमाणु कार्यक्रम
ईरान का परमाणु कार्यक्रम 1950 के दशक में संयुक्त राज्य अमेरिका की मदद से शांति के लिए परमाणु कार्यक्रम (Atoms for Peace program) के रूप में शुरू किया गया था। ईरान के परमाणु कार्यक्रम में संयुक्त राज्य अमेरिका और पश्चिमी यूरोपीय देशों की भागीदारी 1979 ईरानी क्रांति (ईरान के शाह क... | null | null | null |
null | Write a HTML page to set a background color for a table with the color code '#e6e6fa'. | <!DOCTYPE html> <html> <head> <title>Table with Background Color</title> </head> <body> <h1>Table with Background Color</h1> <table style="background-color: #e6e6fa;"> <tr> <th>Name</th> <th>Age</th> <th>Occupation</th> </tr> </table> </body> </html> | |
null | Create a function that produces input strings for a calculator. | def create_input_string(nums, ops): input_str = "" for i in range(len(nums)): if i == 0: input_str += str(nums[i]) else: input_str += ops[i - 1] + str(nums[i]) return input_str | |
[HI Wikipedia] इण्डिया टुडे
इंडिया टुडे एक भारतीय पत्रिका है। यह पत्रिका अंग्रेज़ी ओर हिंदी दोनों भाषाओं में प्रकाशित होती है। इतिहास इंडिया टुडे की स्थापना 1975 में विद्या विलास पुरी (थॉम्पसन प्रेस के मालिक) द्वारा की गई थी, जिसमें उनकी बेटी मधु त्रेहन संपादक और उनके बेटे अरुण पुरी इसके प्रकाशक थे। . वर्तमान में, इंड... | null | null | null |
null | Parse and save the following article in a dataset. | "The Boston Celtics have signed forward Gordon Hayward to a four-year deal. Good move from the Celtics, who are coming off of a teams worst record since 2007? The 29-year-old Hayward has averaged 10.7 points and 5 rebounds per game in his eight-year career" | { "team": "Boston Celtics", "player": "Gordon Hayward", "contract": "Four-year deal", "recent_record": "teams worst record since 2007", "average_points": 10.7, "average_rebounds": 5 } |
null | Develop a function in Python for analyzing a given text and generating a statistical report for finding the word frequencies in the text. | def generate_freq_report(text):
words = {} # to store the word frequencies
text = text.lower()
text = text.replace('\n', ' ')
text = text.split(' ')
for word in text:
if word in words:
words[word] += 1
else:
words[word] = 1
return words | |
null | Design an API endpoint in Python which obtains current weather information based on a user's location. | @app.route('/weather', methods=['GET'])
def get_weather():
lat = request.args.get('latitude')
lon = request.args.get('longitude')
if lat is None or lon is None:
abort(400)
else:
try:
data = requests.get('http://api.openweathermap.org/data/2.5/weather?lat=' + lat + '&lon=' + l... | |
[CS Wikipedia] Členský stát Evropské unie
Evropská unie (EU) se skládá z 27 členských států. Každý členský stát je smluvní stranou zakládajících smluv unie, čímž jako subjekt má výsady a povinnosti vyplývající z členství. Na rozdíl od členů většiny mezinárodních organizací podléhají členské státy EU společným předpisů... | null | null | null |
null | Create a function in Python to generate a 5x5 two-dimensional array with random integers between 0 and 9. | Not applicable | import random
def generateArray():
arr = [[0 for i in range(5)] for j in range(5)]
for i in range (5):
for j in range (5):
arr[i][j] = random.randint(0,9)
return arr
print(generateArray()) |
[HI Wikipedia] लखनऊ
लखनऊ भारतीय राज्य उत्तर प्रदेश का सबसे बड़ा शहर, राजधानी और दूसरा सबसे बड़ा शहरी समूह है। यह प्रशासनिक मुख्यालय के रूप में भी कार्य करता है। 2011 की जनगणना के अनुसार 2.8 मिलियन की आबादी के साथ, यह भारत का ग्यारहवां सबसे अधिक आबादी वाला शहर और बारहवां सबसे अधिक आबादी वाला शहरी समूह है। यह हमेशा एक ब... | null | null | null |
[DE Wikipedia] Purbalingga (Regierungsbezirk)
Purbalingga ist ein indonesischer Regierungsbezirk (Kabupaten) in der Provinz Jawa Tengah, im Zentrum der Insel Java. Mitte 2020 lebten hier über eine Million Menschen. Hauptstadt und Regierungssitz des Verwaltungsdistrikts ist die Stadt Purbalingga. Sie liegt etwa 120 km ... | null | null | null |
null | Create a program that draws a triangle with stars (*) with a given height. | def draw_triangle(n): for i in range(0, n): for j in range(0, i+1): print("*",end="") print("\r") | |
null | Generate a unique 8 digit alphanumeric ID using Java. | String alphaNumericString = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "0123456789" + "abcdefghijklmnopqrstuvxyz"; StringBuilder sb = new StringBuilder(8); for (int i = 0; i < 8; i++) { int index = (int)(alphaNumericString.length() * Math.random()); sb.append(alphaNumericString.charAt(index)); } String generatedID = sb.toString(); | |
[HI Wikipedia] ट्रफ़ैलगर कब्रिस्तान
ट्रफ़ैलगर कब्रिस्तान () ब्रिटिश प्रवासी शासित प्रदेश जिब्राल्टर में स्थित एक कब्रिस्तान है। पहले इसका नाम साउथपोर्ट डिच कब्रिस्तान () था। यह शहर की रक्षक दीवार के एकदम दक्षिण में भूमि के छोटे से टुकड़े पर बना हुआ है, जहाँ स्पेनी शासन के दौरान रक्षात्मक खाई थी। हालांकि इस कब्रिस्तान ... | null | null | null |
null | Create a Python script to parse the given HTML page. | <html>
<head>
<title>Parsing example</title>
</head>
<body>
<h1>Heading</h1>
<ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>
<p>This is a paragraph.</p>
</body>
</html> | from bs4 import BeautifulSoup
html_doc = """
<html>
<head>
<title>Parsing example</title>
</head>
<body>
<h1>Heading</h1>
<ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>
<p>This is a paragraph.</p>
</body>
</html>
"""
soup = BeautifulSoup(html... |
[DE Wikipedia] Horsey Island
Horsey Island ist eine Gezeiteninsel im Parish Thorpe-le-Soken in Essex, England. Sie liegt im Hamford Water, einer Bucht südlich von Harwich, und ist Teil der Hamford Water National Nature Reserve, die unter Aufsicht von Natural England und dem Essex Wildlife Trust steht. Man braucht eine... | null | null | null |
null | Using DOM manipulation, replace the paragraph text with "Hello World". | <p>My first web page</p> | document.querySelector('p').innerHTML = 'Hello World'; |
null | How would you construct a for loop to print out the contents of an array? | arr=[1,3,5,7,9] | for i in range(len(arr)): print(arr[i]) |
null | Improve the performance of the following Python code. | def find_max(a, b):
max_val = a
if b > a:
max_val = b
return max_val | def find_max(a, b):
return max(a, b) |
null | Create a CSS stylesheet for a webpage that centers the heading and makes the background color gray. | body { background-color: gray; } h1 { text-align: center; } | |
null | Generate an array of increasing numbers beginning from 1 of length n. | n=5 | def generate_array(n): """ Generate an array of increasing numbers beginning from 1 of length n """ return [i for i in range(1, n+1)] print(generate_array(5)) |
null | Create a Python function that takes a list of strings and returns a dict with the strings grouped by the length of the strings. | ['word', 'sentence', 'hello', 'programming'] | def group_by_length(lst):
res = {}
for x in lst:
length = len(x)
if length not in res:
res[length] = [x]
else:
res[length].append(x)
return res
input = ['word', 'sentence', 'hello', 'programming']
output = group_by_length(input)
print(output) // {4: ['word', 'hello'], 8: ['sentence'], 11: ['programming']} |
[CS Wikipedia] Skupenské teplo tání
Skupenské teplo tání je (celkové) teplo, které přijme pevná látka při přechodu na kapalinu během tání. Teplo, které přijme 1 kilogram látky se nazývá měrné skupenské teplo tání. Značení Značka: Lt Jednotka SI: joule, značka: J Používané násobky: kilojoule kJ, megajoule MJ Výpočet Ho... | null | null | null |
[CS Wikipedia] Fritování
Fritování je tepelná úprava pokrmu podobná smažení. Na rozdíl od smažení je pokrm při fritování celý ponořen do horkého oleje, jeho příprava je proto rychlejší a rovnoměrnější. Rovněž teplotu oleje lze regulovat, a tak nemusí docházet k nezdravému přepálení oleje. Optimální teplota je 180 °C. ... | null | null | null |
null | Given a string of words, what is the most efficient way to replace the word "a" with "the"? | word_string = "I am learning a lot of new things!" | # Using the replace method new_string = word_string.replace('a', 'the') print(new_string) |
null | Using the following data, generate a random string in Python | data = [“H”, “e”, “l”, “l”, “o”] | import random random_string = "".join(random.choices(data, k=5)) print(random_string) #helll or olleh or leloh or any other combination |
null | Create an algorithm to reverse a given string without using the built-in python reverse function | """
Reverse a given string without using the built-in python reverse function.
"""
def reverse_string(in_str):
rev_str = ''
for i in range(len(in_str) - 1, -1, -1):
rev_str += in_str[i]
return rev_str
if __name__ == '__main__':
in_str = 'reverse me'
rev_str = reverse_string(in_str)
pri... | |
null | Create a python function to parse a character-separated string | Parse a string "Harry,30,England" using comma as separator | def parse_str(str, separator):
strList = str.split(separator)
return strList |
null | Explain how to convert an expression from postfix notation to infix notation | Infix notation is a way of writing an expression in which the operators are placed between the operands, such as 2 + 5, whereas postfix notation is a way of writing an expression in which the operators are placed after the operands, such as 2 5 +. To convert an expression from postfix notation to infix notation, scan t... | |
null | Design an interface for a Python program that parses HTML documents. | Not applicable | from bs4 import BeautifulSoup
class HTMLParser:
def __init__(self, html_doc):
self.html_doc = html_doc
def parse(self):
soup = BeautifulSoup(self.html_doc, 'html.parser')
return soup |
null | Create a list containing the even numbers from #1 to #10. | [2, 4, 6, 8, 10] | |
null | Determine whether a given number is divisible by 3. | n = 15 | if n % 3 == 0: print(str(n) + " is divisible by 3.") else: print(str(n) + " is not divisible by 3.") |
null | Sort an array of integers in ascending order by implementing a Bubble Sort algorithm. | unsorted_list = [8, 5, 3, 1, 9, 6, 0, 7, 4, 2, 5] | def bubble_sort(nums): # Traverse through all array elements for i in range(len(nums)): # Last i elements are already in place for j in range(0, len(nums)-i-1): # traverse the array from 0 to n-i-1 # Swap if the element found is greater # than the next element if nums[j] > nums[j+1] : nums[j], nums[j+1] = nums[j+1], nu... |
[EN Wikipedia] Abatement
Abatement refers generally to a lessening, diminution, reduction, or moderation; specifically, it may refer to: 421-a tax abatement, property tax exemption in the U.S. state of New York Abatement of debts and legacies, a common law doctrine of wills Abatement in pleading, a legal defense to ci... | null | null | null |
null | Write a code in Java for finding the factorial of a number. | 5 | public class Factorial { public static int calcFactorial(int number){ int factorial; if(number == 0 || number == 1){ factorial = 1; } else { factorial = number * calcFactorial(number-1); } return factorial; } public static void main(String[] args){ System.out.println(calcFactorial(5)); } } |
null | Create a web server in Node.js. | const http = require('http'); const hostname = '127.0.0.1'; const port = 3000; const server = http.createServer((req, res) => { res.statusCode = 200; res.setHeader('Content-Type', 'text/plain'); res.end('Hello World\n'); }); server.listen(port, hostname, () => { console.log(`Server running at http://${hostname}:${port}... | |
null | Write Python code to find the nth element of a Fibonacci sequence. | def Fibonacci(n): if n<0: print("Incorrect input") elif n==1: return 0 elif n==2: return 1 else: return Fibonacci(n-1)+Fibonacci(n-2) | |
[HI Wikipedia] संयुक्त राष्ट्र
संयुक्त राष्ट्र एक अन्तर्राष्ट्रीय संगठन है, संक्षिप्त रूप से इसे कई समाचार पत्र संरा भी लिखते हैं। जिसके उद्देश्य में उल्लेख है कि यह अन्तर्राष्ट्रीय कानून को सुविधाजनक बनाने के सहयोग, अन्तर्राष्ट्रीय सुरक्षा, आर्थिक विकास, सामाजिक प्रगति, मानव अधिकार और विश्व शान्ति के लिए कार्यरत है। ... | null | null | null |
[DE Wikipedia] Beach Point
Der Beach Point ( für Strandspitze) bildet die nordöstliche Spitze von Thule Island im Archipel der Südlichen Sandwichinseln. Sie ist gekennzeichnet durch einen blanken Gebirgsrücken und einen schmalen Strandsaum aus Felsbrocken und Kieseln. Wissenschaftler der britischen Discovery Investiga... | null | null | null |
[HI Wikipedia] श्री विद्या
श्री विद्या देवी ललिता त्रिपुरसुन्दरी से सम्बन्धित तन्त्र विद्या का हिन्दू सम्प्रदाय है। ललितासहस्रनाम में इनके एक सहस्र (एक हजार) नामों का वर्णन है। ललितासहस्रनाम में श्रीविद्या के संकल्पनाओं का वर्णन है। श्रीविद्या सम्प्रदाय आत्मानुभूति के साथ-साथ भौतिक समृद्धि को भी जीवन के लक्ष्य के रूप ... | null | null | null |
[CS Wikipedia] Toni Sailer
Anton Engelbert „Toni“ Sailer (17. listopadu 1935 Kitzbühel – 24. srpna 2009 Innsbruck) byl rakouský lyžař, herec a zpěvák. V letech 1972–1976 byl technickým ředitelem a hlavním trenérem rakouské lyžařské federace a v letech 1986–2006 ředitelem sjezdovky Hahnenkamm. Byl zároveň technickým ře... | null | null | null |
[CS Wikipedia] Metelka
Metelka je české příjmení, jež vzniklo zdrobněním ze slova metela, metelice = vánice, nebo ze slovesa metelit = utíkat (podobně vznikla příjmení Metel, Metelák, Metelec). Ženskou variantou je Metelková. Příjmení Metelka nosí více osobností: Bohuslav Metelka (1885–1960) – jihlavský malíř, kreslíř... | null | null | null |
[EN Wikipedia] Lactarius chrysorrheus
Lactarius chrysorrheus (sometimes spelt Lactarius chrysorheus) is a member of the genus Lactarius, whose many members are commonly known as milkcaps. It has recently been given the English (common) name of the yellowdrop milkcap. It is pale salmon in color, poisonous, and grows in... | null | null | null |
null | Create an HTML page to display the employee details. | Employee Name: Oliver Smith Age: 35 Role: Marketing Executive | <html> <head> <title>Employee Details</title> </head> <body> <h1>Employee Details</h1> <p>Name: Oliver Smith</p> <p>Age: 35</p> <p>Role: Marketing Executive</p> </body> </html> |
null | Create a Python program to die arbitary shape black and white using matplotlib | Not applicable | import matplotlib.pyplot as plt
# Generating random coordinates
x = np.random.randint(0,100,100)
y = np.random.randint(0,100,100)
# Use the coordinates to plot a black and white shape
plt.scatter(x, y, c='black')
plt.fill_between(x, y, color='white')
plt.show() |
null | Generate code in Python to convert an infix expression into a postfix expression. | # Function to convert Infix expression to Postfix
def infixToPostfix(expression):
# empty list that will store the postfix expression
postfix = []
# dictionary containing the precedence value of operators
precedence = {'^':3, '*':3, '/':3, '+':2, '-':2, '(':1}
# Stack to store operators
stack = []
# Iterat... | |
null | Write a C++ code to generate a random number in the range 0 - 1000. | #include <cstdlib> #include <time.h> //Generating random number int random_number = rand() % 1001; // Print the random number cout << random_number; | |
[CS Wikipedia] Intimní osvětlení
Intimní osvětlení je český film, natočený v roce 1965 režisérem Ivanem Passerem jako jeho dlouhometrážní debut. Film byl natáčen v reálných interiérech s hrajícími neherci, což mu přineslo velkou míru autentičnosti. Postupně se stal význačným filmem české nové vlny, byl přijat pozitivn... | null | null | null |
null | Construct a Python program to find the difference between the maximum and minimum values in a given array of integers. | [1, 8, 4, 5, 9] | def diffMaxMin(arr):
maxVal = arr[0]
minVal = arr[0]
for num in arr:
if num > maxVal:
maxVal = num
elif num < minVal:
minVal = num
return maxVal - minVal
arr = [1, 8, 4, 5, 9]
result = diffMaxMin(arr)
print(result) |
[CS Wikipedia] Mutaz Essa Baršim
Mutaz Essa Baršam (, ; * 24. června 1991 Dauhá) je katarský atlet, jehož specializací je skok do výšky, mistr světa z roku 2017, 2019 a 2022 . Sportovní kariéra Začínal s během a se skokem do dálky. Své nynější disciplíně se věnuje od 15 let. V roce 2009 ho začíná trénovat Polák Stanis... | null | null | null |
null | Read the given code block and debug it. | def main(): print("Hey I'm here") if n == 0: print("Hey I'm there") main() | Error: n is not defined. The given code is trying to use the variable n, which is not declared. To fix this, it should be declared before the if statement. The modified code is as follows: def main(): print("Hey I'm here") n = 0 if n == 0: print("Hey I'm there") main() |
[EN Wikipedia] Alaigal (film)
Alaigal () is a 1973 Indian Tamil-language film written, produced and directed by Sridhar. The film, released on 13 January 1973, stars Vishnuvardhan and Chandrakala. It was the first Tamil film of Vishnuvardhan. Plot Cast Vishnuvardhan as Inspector Raju Chandrakala as Lakshmi Cho Manoram... | null | null | null |
[CS Wikipedia] Brasil Open 2018
Brasil Open 2018 byl tenisový turnaj pořádaný jako součást mužského okruhu ATP World Tour, který se odehrával v hale Ginásio do Ibirapuera na antukových dvorcích, kam se po dvou letech vrátil z otevřeného areálu Esporte Clube Pinheiros. Probíhal mezi 26. únorem až 4. březnem 2018 v braz... | null | null | null |
null | Write a SQL query that finds the average of a given table's "Salary" column. | SELECT AVG(Salary) FROM Employees; | |
null | Create a function in Python that takes two strings and combines the characters of each string keeping the order of the characters. | foo
bar | def combine(s1, s2):
result = ""
for i in range(max(len(s1), len(s2))):
if i < len(s1):
result += s1[i]
if i < len(s2):
result += s2[i]
return result |
null | Create a Python function to calculate the maximum subarray sum. | [2, -5, 4, -2, 7, -1] | def max_subarray_sum(arr):
# Keep track of the current sum and the maximum sum
current_sum = 0
max_sum = float('-inf')
# Iterate over the array and update the current/max sum
for num in arr:
current_sum += num
max_sum = max(max_sum, current_sum)
current_sum = max(curren... |
null | Create a class in Java that will print the two integers added together. | public class Addition { public static int add(int x, int y) { return x + y; } public static void main(String[] args) { System.out.println(add(5,7)); } } | |
null | Convert a Python program to handle multiple input threads simultaneously. | def function(x):
time.sleep(1)
return x * x
for i in range(5):
x = int(input())
result = function(x)
print(result) | import threading
import time
def function(x):
time.sleep(1)
return x * x
def worker(x, i):
result = function(x)
print("Result of", i, "is", result)
# main
i = 0
while i < 5:
t = threading.Thread(target=worker, args=(int(input()), i))
print("Started thread", i)
t.start()
i += 1 |
null | Write a function in Python that chooses a random element from a list. | [1, 2, 3, 4, 5] | import random
def randomElement(list):
return random.choice(list)
print(randomElement([1,2,3,4,5])) |
null | Generate an optimized Python code that computes the product of two numbers without using the multiplication operator. | The numbers are 3 and 7 | def product_without_mul(x, y):
result = 0
while (y > 0):
partial_result = 0
for i in range(y):
partial_result += x
result += partial_result
y -= 1
return result
x = 3
y = 7
print("Product of two numbers without using
multiplication operator is ", product_without_mul(x, y)) |
[CS Wikipedia] Laura Tamminenová
Laura Tamminenová byla finská rychlobruslařka. Od roku 1933 se pravidelně účastnila finských šampionátů. Při svém premiérovém startu se umístila na druhém místě, o rok později byla třetí. V letech 1935 a 1936 si shodně dobruslila pro druhou příčku. Třetího místa dosáhla v letech 1937 a... | null | null | null |
null | Select all the records from a SQL table where the `name` column contains the value `John`. | SELECT * FROM table_name WHERE `name` LIKE '%John%'; | |
null | Create a Python program to fetch a book from the Open Library API given its ISBN. The program should return the following information about the book: title, author, and description. | ISBN: 9781400079170 | import requests
ISBN = '9781400079170'
params = {'bibkeys': ISBN, 'format': 'json', 'jscmd': 'details'}
request = requests.get('https://openlibrary.org/api/books', params=params)
data = request.json()
book = data[f'OLID:{ISBN}']
title = book['title']
author = book['authors'][0]['name']
description = book['descriptio... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.