← 목록

Synth · CodeAlpaca일부

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

[output] | <html> <head> <title>Contact Us</title> </head> <body> <h1>Contact Us</h1> <form> Name: <input type="text" name="name"/><br /> Email: <input type="text" name="email"/><br /> Message: <input type="text" name="message"/><br /> [instruction] | Create an HTML page containing a form labeled "Contact Us" containing 3 input fields named: name, email, and message. [input] |

[output] | function filterArrayValues(array, value) { return array.filter(x => x > value); } if __name__ == '__main__': array = [1, 2, 4, 5, 6, 8]; value = 5; print(filterArrayValues(array, value)) [instruction] | Write a JavaScript code to filter the values of an array which are greater than a given number. [input] | array = [1, 2, 4, 5, 6, 8]; value = 5;

[output] | public static double threeIntAvg(int a, int b, int c) { return (a + b + c) / 3.0; } [instruction] | Create a Java method that takes three integers as parameters and computes their average. [input] |

[output] | input.button { ... } [instruction] | Create a CSS selector to target the inputs elements with a class 'button'. [input] |

[output] | import React from 'react'; const Link = () => ( <a href="/">Visit my website</a> ); export default Link; [instruction] | Create a React component that renders a HTML anchor link with the text "Visit my website". [input] |

[output] | setcookie('username', 'foo', 0); [instruction] | Write a PHP snippet to set cookie for the current page with the name "username" and value "foo". [input] |

[output] | SELECT * FROM employees WHERE state = 'California' AND salary > 80000; [instruction] | Create a SQL query to find the employees who live in California and earn more than $80,000 per year. [input] |

[output] | div.container:nth-child(2), div.container:nth-child(3) { ... } [instruction] | Create a CSS selector to target the second and third <div> element with the class 'container'. [input] |

[output] | SELECT department, COUNT(*) FROM employees GROUP BY department HAVING COUNT(*) > 3; [instruction] | Create a SQL query to find all the departments with more than 3 employees. [input] |

[output] | 1010 [instruction] | Convert 10 decimals to binary. [input] | 10

[output] | <html> <head> </head> <body> <input type="text" name="username"/> </body> </html> [instruction] | Write an HTML page containing an <input> element with the name "username". [input] |

[output] | SELECT DISTINCT * FROM <table_name>; [instruction] | Write a query to select a distinct list of data from an SQL table. [input] |

[output] | my_dict = { "key1": [1, 2, 3], "key2": [4, 5, 6] } [instruction] | Create a dictionary with two keys and a list of values assigned to each key. [input] |

[output] | import random my_arr = [random.randint(1,100) for _ in range(10)] print(my_arr) # Output: [76, 64, 26, 62, 59, 35, 66, 18, 52, 49] [instruction] | Generate an array of random numbers with a size of 10. [input] |

[output] | def compare_lists(list1, list2): if len(list1) != len(list2): return False else: for i in range(len(list1)): if list1[i] != list2[i]: return False return True list1 = [1, 2, 3] list2 = [2, 3, 4] print(compare_lists(list1, list2)) # Out [instruction] | Write a function to compare two lists and print out whether they are equal or not. [input] | list1 = [1, 2, 3] list2 = [2, 3, 4]

[output] | my_list = [2, 4, 6, 8, 10, 12] print(my_list[-3:]) # Output: [10, 12] [instruction] | Write Python code to print the last three elements from a given list. [input] | [2, 4, 6, 8, 10, 12]

[output] | To implement a Skip-Gram model in TensorFlow, you would need to define the model architecture. You would then need to define the training data, which can be done using tf.data packages. Finally, you would need to use an optimization algorithm such as the AdamOptimizer to train the model. [instruction] | How would you implement Skip-Gram model in TensorFlow? [input] |

[output] | class Person: num_objects = 0 def __init__(self): Person.num_objects += 1 def print_num_objects(self): print(Person.num_objects) [instruction] | Create a Python class with an instance method that prints the number of objects created. [input] |

[output] | my_dict = { 'name': 'John', 'age': 30, 'city': 'New York' } for key, value in my_dict.items(): print(f'{key}: {value}') [instruction] | Create a Python dictionary with three elements and print the key-value pairs. [input] |

[output] | HloWrd [instruction] | Delete every third character in a string. [input] | String: "Hello World"

[output] | 6 [instruction] | Find the first unique number in the list. [input] | [1,2,3,4,5,5,4,3,2,1,6]

[output] | 84 [instruction] | Sum all the numbers divisible by 3 and 7 in the list. [input] | [27, 21, 63, 77, 49]

[output] | """ Function to format a number with two decimal places """ def two_decimals(num): """ Format a number with two decimal places """ return "{:.2f}".format(num) if __name__ == '__main__': print(two_decimals(23.14159)) # prints 23.14 [instruction] | Write a code to format a number with two decimal places. [input] | 23.14159

[output] | """ Function to calculate the sum of the cubes of the numbers in the list """ def list_cube_sum(list): """ Calculate the sum of the cubes of the numbers in the list """ total = 0 for i in list: total += i**3 return total if __name__ == '__main__': print(list_cube [instruction] | Write a code to calculate the sum of the cubes of the numbers in the list. [input] | [1,2,3,4,5]

[output] | list = [x.strip() for x in "apple, banana, peach, orange".split(",")] [instruction] | Take the following string and read it into a list in Python. [input] | "apple, banana, peach, orange"

[output] | def reverse_inplace(head): if head is None or head.next is None: return head prev_node = None next_node = None curr_node = head while curr_node is not None: next_node = curr_node.next curr_node.next = prev_node prev_node = curr [instruction] | How would you reverse the order of the elements in a given singly linked list in-place? [input] |

[output] | sorted_dict = dict(sorted({"SPACELINE": "Flight of the Future", "LUCY": "Rocket Science"}.items(), key=lambda x: x[1])) [instruction] | Take the following dictionary and sort its values alphabetically. [input] | {"SPACELINE": "Flight of the Future", "LUCY": "Rocket Science"}

[output] | int variable; String variable = ""; boolean variable = false; [instruction] | Which of the following is a valid way to declare a variable in Java? [input] |

[output] | var XHR = new XMLHttpRequest(); XHR.onreadystatechange = function () { if (XHR.readyState == 4 && XHR.status == 200) { var data = JSON.parse(XHR.responseText); // Handle the response data here } }; XHR.open("GET", url); XHR.send(); [instruction] | Suggest a JavaScript code to make an AJAX request to fetch data from a server. [input] |

[output] | ^[a-zA-Z0-9]+$ [instruction] | Suggest a regex pattern to match a valid alphanumeric string. [input] |

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