← 목록

Synth · CodeAlpaca일부

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

[output] | The Django web application should have the following components: a) a simple UI with a newsfeed list, b) a view to fetch news items from different sources, c) a web scraper to fetch web pages and presenting them on the newsfeed list, d) a database to store news items, and e) a settings page to add o [instruction] | Create a Newsfeed Aggregator Django web application that displays the latest news from different sources. [input] |

[output] | The sentiment in the sentence is positive. [instruction] | Perform sentiment analysis on the given sentence. [input] | Sentence: She shoved the latest game console into her shopping cart.

[output] | The web API should be able to perform web scraping and screen scraping of webpages. It should accept a URL as input, fetch the content and parse it to extract the relevant data. The API should expose this data to the user in either a JSON or XML format. Additionally, the API should also provide opti [instruction] | Create a web API in Node.js which can fetch and extract data from a website. [input] |

[output] | <!DOCTYPE html> <html> <head> <title>TITLE</title> <script src="https://unpkg.com/@angular/core@8.2.14/bundles/core.umd.js"></script> <script src="https://unpkg.com/@angular/common@8.2.14/bundles/common.umd.js"></script> <script src="https://unpkg.com/@angular/platform-browser@8.2. [instruction] | Change the following HTML page to an Angular web page. [input] | <html> <head> <title>TITLE</title> </head> <body> <h1>HEADER</h1> <p>Paragraph</p> </body> </html>

[output] | The sentiment for the sentence is positive with an accuracy of 70%. [instruction] | Quantify sentiment for the following sentence. [input] | Sentence: She was content with the results.

[output] | The React application should have a registration form that includes fields for the user's name, email address, password and repeat password. The form should also display an appropriate message when the user provides invalid input or leaves a particular field blank. Additionally, the form should also [instruction] | Create a React application with a registration form. [input] |

[output] | The GraphQL API should use Python's Graphene library to create the schema. The API should have a root query and necessary fields, as well as a Global ID and Node interface for each of the database's tables. The API should also support CRUD operations, enabling the clients to query or modify the data [instruction] | Create a GraphQL API to serve data from a database in Python. [input] |

[output] | <?php //Printing the christmas tree $height = 5; // Looping through rows for ($i = 1; $i <= $height; $i++) { // Print Spaces for ($k = $height; $k > $i; $k--) { echo " "; } // Print Stars for ($j = 1; $j [instruction] | Write a PHP program to print a Christmas tree on the console. [input] |

[output] | SELECT * FROM CompanyDB.Employees; [instruction] | Create an SQL query to select all columns from the table "Employees" in a database named "CompanyDB". [input] |

[output] | <?php function calculateArea($length,$width){ return $length * $width; } echo calculateArea(10,20); ?> [instruction] | Write a PHP function named "calculateArea" to calculate the area of a rectangle. [input] | length = 10 width = 20

[output] | SELECT AVG(salary) FROM CompanyDB.Employees; [instruction] | Write a SQL query to find the average salary from from the table "Employees" in a database named "CompanyDB". [input] |

[output] | prime_numbers = [] for num in range(1, 11): if num > 1: for i in range(2, num): if (num % i) == 0: break else: prime_numbers.append(num) print(prime_numbers) [instruction] | Create a simple Python script to print the first 10 prime numbers. [input] |

[output] | h1 { color:#000000; font-size:16px; } [instruction] | Create a basic CSS style sheet to set a color and font size for the <h1> element. [input] | color = #000000 font_size = 16px

[output] | #include <iostream> #include <vector> #include <cstdlib> #include <ctime> using namespace std; int main() { srand(time(0)); //define random numbers to be guessed int max_limit = 6; vector<int> ans; for (int i = 0; i < 4; i++) { ans.push_back((rand() % max_limit) + 1); } int attempts = 0; [instruction] | Create a Mastermind game in any language of your choice. [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!'); }); server.listen(port, hostname, () => { console.log(`Server runnin [instruction] | Create a Node.js web server that responds to an HTTP GET request with a simple "Hello, World!" message. [input] |

[output] | int[] intArray = new int[5]; [instruction] | Write a Java code snippet to create an array of integers of length 5. [input] |

[output] | import { Component } from '@angular/core'; @Component({ selector: 'form-input', template: ` <form> <input type="text" id="textInput" /> <button type="submit">Submit</button> </form> ` }) export class FormInput { } [instruction] | Create an Angular component named "FormInput" with a text field and a submit button. [input] |

[output] | import numpy as np import pandas as pd from sklearn.svm import SVC from sklearn.model_selection import train_test_split from sklearn.metrics import accuracy_score # read in the data df = pd.read_csv('data.csv') # separate the features and labels X = df.drop('cancer', axis=1) y = df['cancer'] # sp [instruction] | Create a machine learning model to predict the probability of a patient having a certain type of cancer. [input] | features = [Height, Weight, Age, Gender]

[output] | import matplotlib.pyplot as plt import seaborn as sns # Explore data sns.pairplot(data_df, hue='pos_sentiment') plt.show() # Fit a regression line sns.regplot(x="n_tweets", y="pos_sentiment", data=data_df) plt.xlabel('Number of Tweets') plt.ylabel('Positive Sentiment') plt.show() [instruction] | Explore the data_df dataframe and build a visualization that answers the following question: what is the correlation between number of tweets sent and positive sentiment? [input] | data_df: DataFrame containing columns such as n_tweets,pos_sentiment

[output] | import re pattern = r'\b[a-zA-Z]*a[a-zA-Z]*z[a-zA-Z]*\b' words = re.findall(pattern, "The quick brown fox jumped over the lazy dog") for word in words: print(word) [instruction] | Create a regex string to find all words that contain the letters 'a' and 'z' in them. [input] |

[output] | import java.util.Scanner; public class PascalTriangle { public static void main(String[] args) { // Read in the number of lines System.out.println("Enter the number of lines: "); Scanner scan = new Scanner(System.in); int n = scan.nextInt(); // Print out pascal triangle for(int li [instruction] | Create a Java program to read in a number n, and print out the first n lines of Pascal's triangle. [input] | n = 5

[output] | //Function to get the current day of the month function getCurrentDay() { let today = new Date(); return today.getDate(); } console.log(getCurrentDay()); [instruction] | Write a JavaScript function to get the current day of the month. [input] |

[output] | //Function to find the total number of occurrences of a pattern p in a large string S function findOccurrences(S, p) { let count = 0; let initialIndex = 0; while (S.indexOf(p, initialIndex) !== -1) { initialIndex = S.indexOf(p, initialIndex) + 1; count++; } conso [instruction] | Given a large string S, find the total number of occurrences of a pattern p in S. [input] | S = “Mississippi”, p = “si”

[output] | <html> <head> <title>Employees</title> </head> <body> <h1>Employees</h1> <ul> <li>John Doe - Sales - 35000 - 50000</li> <li>Jane Doe - Marketing - 40000 - 65000</li> </ul> </body> </html> [instruction] | Create a HTML page to show a list of employees, their departments and corresponding salary ranges. [input] | John Doe - Sales - 35000 - 50000 Jane Doe - Marketing - 40000 - 65000

[output] | function extractChars(str, num){ return str.substring(0, num); } var str = "hello world"; var output = extractChars(str, 5); console.log(output); // Output: hello [instruction] | Write a JavaScript function to extract a specified number of characters from a string. [input] | String: hello world Number: 5

[output] | An efficient data structure for finding the closest element to a given element in a set of elements is the KD Tree. The KD Tree is a space-partitioning data structure for organizing points in a k-dimensional space and taking advantage of their spacial locality. A KD Tree is a binary tree with each n [instruction] | Design a data structure for efficiently finding the closest input to a given input in a set of inputs. [input] |

[output] | def staircase(n): for i in range(1, n + 1): for j in range(1, n + 1): if (j <= (n - i)): print(end="\t") else: print("#\t", end="") print() [instruction] | Write a Python function that prints out a staircase pattern. [input] |

[output] | float y = (float)x; [instruction] | Write a Java statement to convert an int to float. [input] | int x = 10;

[output] | let animal = { name: '', type: '', sound: '' } [instruction] | Create an object syntax in JavaScript to represent an animal. [input] |

[output] | for (let i = 0; i < arr.length; i++) { console.log(arr[i]); } [instruction] | Write a JavaScript code snippet to create a loop using an array. [input] | let arr = [1, 2, 3, 4, 5]

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