← 목록

Synth · CodeAlpaca일부

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

[output] | Create a new folder for your theme, name it "mytheme". Open a text editor and a web browser. Create a style.css file in your theme folder. Add all the CSS styles as required to make your theme looks as desired. Create an index.php file in your theme folder, and add the code to create a basic layou [instruction] | Create a Wordpress theme from scratch. [input] |

[output] | /[A-Z][a-z]+/g [instruction] | Convert this regular expression to JavaScript regex expression. [input] | /[A-Z][a-z]+/

[output] | public class StockPrice { public static void main(String[] args) { double[] stock_prices = {10.25, 11.94, 12.56, 11.13, 11.44}; double stock_price_sum = 0; for(double stock_price : stock_price) { stock_price_sum += stock_price; } double stock_price_mean = stock_price_su [instruction] | Create a Java application to calculate the mean stock price of a company in the last 5 days. [input] | [10.25, 11.94, 12.56, 11.13, 11.44]

[output] | let arr = [20, 40, 60, 80, 100]; console.log(arr[0], arr[1], arr[2]); [instruction] | Print the first, second and third element of this array in JavaScript. [input] | [20, 40, 60, 80, 100]

[output] | SELECT * FROM employees WHERE start_date > DATE_SUB(NOW(), INTERVAL 5 YEAR) AND salary > 100000; [instruction] | Write an SQL query to select the data of all the employees who joined in the last 5 years and earn more than $100,000. [input] |

[output] | <style> table, th, td { border: 1px solid black; } </style> <table> <thead> <th>Column 1</th> <th>Column 2</th> <th>Column 3</th> <th>Column 4</th> </thead> <tbody> <tr> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td></ [instruction] | Using HTML and CSS, create a table containing 3 rows and 4 columns. [input] |

[output] | SELECT first_name FROM customers; [instruction] | Formulate a query to select the first names of customers from the customers table. [input] | Table Name: customers

[output] | $.get('http://example.com/items', function(data) { // Code to handle the response }); [instruction] | Make an AJAX request to get the list of items from a server. [input] | Endpoint URL: http://example.com/items

[output] | function saveArrayToLocalStorage(arr) { localStorage.setItem('array', JSON.stringify(arr)); } [instruction] | Write a JavaScript function to safe an array at the local storage. [input] | [10, 20, 30]

[output] | male_count <- nrow(people[people$Gender == "Male", ]) female_count <- nrow(people[people$Gender == "Female", ]) total <- nrow(people) male_percentage <- (male_count / total) * 100 female_percentage <- (female_count / total) * 100 print(paste0('Percentage of males:', male_percentage, '%')) print(pa [instruction] | Create an R program to find the percentage of males and females in a given dataset. [input] | Table Name: people

[output] | <script> document.getElementById("button").onclick = () => { // Your code goes here }; </script> [instruction] | Add a ‘onclick’ event to the element with ID ‘button’. [input] |

[output] | SELECT * FROM customers WHERE gender != 'female'; [instruction] | Formulate a query to select the records from the customers table where the gender is not equal to 'female'. [input] | Table Name: customers

[output] | import React, { useState } from 'react'; const MyForm = () => { const [text1, setText1] = useState(''); const [text2, setText2] = useState(''); const [text3, setText3] = useState(''); return ( <form> <input type="text" value={text1} onChange={e => setText1(e.target.value)} /> [instruction] | Create a React component for a form with three text boxes. [input] |

[output] | arr.forEach(function(el) { console.log(el); }); [instruction] | Write a code in JavaScript for iterating over an array and print each element. [input] | arr = [1, 2, 3, 4]

[output] | String str = "dog"; [instruction] | Edit the code to convert the string "cat" to "dog". [input] | String str = "cat"

[output] | SELECT SUM(o.cost) FROM orders o WHERE strftime('%m', o.date) = '05'; [instruction] | Write a query in SQL to calculate the total cost of orders placed in the month of May. [input] |

[output] | // remove element at index 2 for (int i=2; i< arr.length-1; i++) arr[i] = arr[i+1]; // Reduce size of array by 1 int len = arr.length -1; int[] newarr = new int[len]; for (int i=0; i<newarr.length; i++) newarr[i] = arr[i]; [instruction] | Edit the code to delete the element with value 6 from the array. [input] | int arr[] = {2, 4, 6, 8, 10}

[output] | The prime factors of 54 are 2, 3, 3, and 3. [instruction] | Compute the prime factors of the number 54. [input] |

[output] | SELECT * FROM customers WHERE name LIKE 'John%'; [instruction] | Create an SQL query to find all the records in the 'customers' table that have a name that starts with 'John'. [input] |

[output] | The result of 15 * (3 + 7) is 150. [instruction] | Evaluate the following JavaScript expression: 15 * (3 + 7) [input] |

[output] | <p style="font-family: Helvetica, sans-serif; font-size: 30px">This text should be different</p> [instruction] | Modify the below HTML code to make the text show with a different font and font size. [input] | <p>This text should be different</p>

[output] | def sum_vector(x): """Returns the sum of all elements in a vector x.""" total = 0 for num in x: total += num return total sum_vector(x) # returns 28 [instruction] | Given a vector x containing N elements, write a Python function to compute and return the sum. [input] | x = [2, 3, 5, 7, 11]

[output] | <a href="https://www.example.com">Click here to go to another page.</a> [instruction] | Create an HTML page containing a link that redirects the user to another page, when clicked. [input] |

[output] | def arr_length(arr): """Returns the length of a given array.""" return len(arr) arr_length(arr) # returns 4 [instruction] | Write a function to evaluate the length of an array. [input] | arr = [1, 3, 5, 6]

[output] | function evenNumbers(arr) { return arr.filter(num => num % 2 === 0); } evenNumbers(arr) # returns [2, 4, 6] [instruction] | Write a JavaScript function to filter all numbers in an array and return a new array containing only the even numbers. [input] | arr = [1, 2, 3, 4, 5, 6]

[output] | def get_students_by_grade(students,grade): """Returns a list of students with a given grade.""" filtered_list = [] for student in students: if student["grade"] == grade: filtered_list.append(student) return filtered_list get_students_by_grade(students, 'A') # ret [instruction] | Create a function to return all students with a given grade. [input] | students = [ {'name': 'John', 'grade': 'A'}, {'name': 'Jane', 'grade': 'B'}, {'name': 'Dave', 'grade': 'A'}, {'name': 'Chris', 'grade': 'C'}, ]

[output] | SELECT * FROM employees WHERE salary > 50000; [instruction] | Change the following SQL query so that it only returns rows from the 'employees' table where the salary is higher than 50000. [input] | SELECT * FROM employees

[output] | words = "I love coding" for word in words.split(): print(word) [instruction] | Write a Python 3 script to print out all the words in the string 'I love coding'. [input] |

[output] | a { color: purple; } [instruction] | Create a CSS style to make all the links on a webpage have the color purple. [input] |

[output] | #define display_message() printf("DONE\n") [instruction] | Change the following Define statement so that it will display a message containing the word “DONE” when the code is executed. [input] | #define display_message()

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