← 목록

Synth · CodeAlpaca일부

총 20,022개 · 페이지 648/668
🔀 랜덤
불러오는 중…

[output] | <form> <input type="text" name="name" placeholder="Name"> <input type="number" name="age" placeholder="Age"> <input type="email" name="email" placeholder="Email"> <input type="password" name="password" placeholder="Password"> <input type="text" name="address" placeholder="Address"> <input type [instruction] | Design an HTML form with five input fields and three buttons [input] |

[output] | openssl genpkey -algorithm RSA -out rsa_key.pem -pkeyopt rsa_keygen_bits:2048 [instruction] | Use openssl to generate a RSA public/private key pair. [input] |

[output] | 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 runnin [instruction] | Create a web server in Node.js. [input] |

[output] | def prime_check(n): if n < 2: return False if n == 2: return True if not n & 1: return False for x in range(3, int(n**0.5) + 1, 2): if n % x == 0: return False return True [instruction] | Write an algorithm that verifies whether an integer is a prime number [input] |

[output] | One example of a natural language processing task solved using supervised learning is sentiment analysis. Through supervised learning, sentiment analysis models classify text as sentimentally positive or negative, with inputs such as words, phrases, and conversations. Supervised learning algorithms [instruction] | give an example of a natural language processing task solved using supervised learning. [input] |

[output] | def is_palindrome(str): # First convert all to the same case str = str.lower() return str == str[::-1] [instruction] | Write a function to check for palindrome [input] | str = "abcba"

[output] | def remove_primes(list): modified_list = [] for idx, num in enumerate(list): if is_prime(idx) == False: modified_list.append(num) return modified_list [instruction] | From a given list, remove all elements that have a prime index. [input] | list = [4, 7, 10, 11, 14]

[output] | // This is a basic example of a REST API that returns weather information for specific cities. app.get('/weather', (req, res) => { const cityNames = req.query.cities.split(','); const cities = { 'New York City': { lat: 40.7128, lng: 74.0060 }, 'Los Angeles': { lat: 34.0522, lng: 118.243 [instruction] | Create a basic REST API for getting information about weather for specific cities. [input] | 3 cities with their respective latitude and longitude: - New York City (40.7128°N, 74.0060°W) - Los Angeles (34.0522°N, 118.2437°W) - San Francisco (37.7749°N, 122.4194°W)

[output] | a = 10 # integer b = "Hello" # string c = [1,2,3] # list d = { "name": "John", "age": 30 } # dictionary [instruction] | Create 4 variables with the following data types with appropriate values: [input] |

[output] | Sports [instruction] | Classify the given article into its corresponding category. [input] | Article: The 2020 Tokyo Olympics is postponed until 2021 due to the ongoing pandemic.

[output] | my_string = my_string.lower() [instruction] | Convert this string from uppercase to lowercase. [input] | my_string = "HELLO WORLD"

[output] | def filter_positives(numbers): result_list = [] for element in numbers: if element >= 0: result_list.append(element) return result_list [instruction] | Create a function to filter out positive numbers from a given array. [input] | numbers = [-5, 3, 7, -2, 4, 9]

[output] | This code doesn't work because it doesn't follow the formula for converting Celsius temperatures to Fahrenheit. The formula for converting Celsius to Fahrenheit is F = (C * 9/5) + 32, where F is the Fahrenheit temperature and C is the Celsius temperature. The code provided only adds 5 to the Celsius [instruction] | Explain why this code doesn't work. [input] | def celsius_to_fahrenheit(celsius): return celsius + 5

[output] | def cumsum(lst): sum = 0 new_lst = [] i = 0 while i < len(lst): sum += lst[i] new_lst.append(sum) i += 1 return new_lst [instruction] | Convert this function from a for loop to a while loop. [input] | def cumsum(lst): sum = 0 new_lst = [] for n in lst: sum += n new_lst.append(sum) return new_lst

[output] | class CustomMessage: def __init__(self): print("This is a custom message!") [instruction] | Write a short class in Python that will print a custom message when created. [input] |

[output] | for(let i=0; i<=5; i++) { console.log(i); } [instruction] | Write a for loop in JavaScript that prints numbers from 0 to 5. [input] |

[output] | for (int i = 0; i < 2; i++) { printf("%s\n", list[i]); } [instruction] | Given a list of strings, how can we print each string on a new line in C? [input] | ["Hello", "world"]

[output] | We can handle multiple parameters in a single function by using the spread operator (...) which will allow us to pass any number of arguments to the function. [instruction] | How can we handle multiple parameters in a single function in JavaScript? [input] |

[output] | let sum = 0; for (let i = 0; i < array1.length; i++) { sum += array1[i] + array2[i]; } console.log(sum); [instruction] | Using the arrays below, write a for loop in JavaScript to print out the sum of the two arrays. [input] | array1 = [1,2,3] array2 = [4,5,6]

[output] | truth_table = {"p": [True, False], "q": [True, False], "p ⊕ q": [(not(p) and q) or (p and not(q)) for p in truth_table["p"] for q in truth_table["q"]]} [instruction] | How can we create an exclusive truth table using the boolean operators in Python? [input] |

[output] | def rotate90(arr): new_arr = [[row[i] for row in arr[::-1]] for i in range(len(arr[0]))] return new_arr [instruction] | You are given a 2D array and you need to rotate it 90 degrees clockwise. [input] | array = [ [1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16], ]

[output] | str.upper() [instruction] | Given a string, convert all lowercase characters to uppercase. [input] | str = 'hello World'

[output] | arr = [1,2,3,4,5] if arr.include?(3) puts 'Value 3 present in the array.' end [instruction] | Write a Ruby program to check for the existence of a given value in an array. [input] | Given array: [1,2,3,4,5], value to be checked: 3

[output] | function replaceNonAlphabets(str){ return str.replace(/[^a-zA-Z]/g, '#'); } [instruction] | Write a JavaScript function to replace all non-alphabetical characters in a string with the symbol ‘#’. [input] | Given string: "Hello, world!"

[output] | <!DOCTYPE html> <html> <head> <title>Simple Table Layout</title> </head> <body> <h1>Table with Three Columns</h1> <table> <tr> <th>Name</th> <th>Age</th> <th>Occupation</th> </tr> </table> </body> </html> [instruction] | Write an HTML page to display three columns with headings ‘Name’, ‘Age’ and ‘Occupation’ in a table layout. [input] |

[output] | <!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> </tabl [instruction] | Write a HTML page to set a background color for a table with the color code '#e6e6fa'. [input] |

[output] | def prime_numbers(start_num, end_num): prime_nums_list = [] for num in range(start_num, end_num + 1): # all prime numbers are greater than 1 if num > 1: for i in range(2,num): if (num % i) == 0: break els [instruction] | Build a Python program to generate a prime numbers list in a given range. [input] |

[output] | This is a string with puncutation and it is not good [instruction] | From a given string, remove all the punctuations. [input] | This is a string with puncutation, and it is not good.

[output] | test [instruction] | Read the following code and identify the name of the function. [input] | x = 4 def test(): return x

[output] | 55 [instruction] | Calculate the nth fibonacci number in the series. [input] | n = 10

← → 방향키로 페이지 이동 · 숫자 입력 후 Enter로 점프