| {"messages":[{"role":"user","content":"I want to check whether a number is prime using Python."},{"role":"assistant","content":"def is_prime(n):\n if n < 2:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True"}]} | |
| {"messages":[{"role":"user","content":"I need a JavaScript function that debounces another function call."},{"role":"assistant","content":"function debounce(fn, delay) {\n let timer;\n return function(...args) {\n clearTimeout(timer);\n timer = setTimeout(() => fn.apply(this, args), delay);\n };\n}"}]} | |
| {"messages":[{"role":"user","content":"I would like to check if a value exists inside a slice in Go."},{"role":"assistant","content":"func contains(arr []int, val int) bool {\n for _, v := range arr {\n if v == val {\n return true\n }\n }\n return false\n}"}]} | |
| {"messages":[{"role":"user","content":"Can you show me how to write a recursive factorial function in Rust?"},{"role":"assistant","content":"fn factorial(n: u64) -> u64 {\n if n == 0 { return 1; }\n n * factorial(n - 1)\n}"}]} | |
| {"messages":[{"role":"user","content":"I want to implement factorial using recursion in C++."},{"role":"assistant","content":"int factorial(int n) {\n if (n == 0) return 1;\n return n * factorial(n - 1);\n}"}]} | |
| {"messages":[{"role":"user","content":"Please generate Fibonacci numbers using Python in a simple loop."},{"role":"assistant","content":"def fib(n):\n a, b = 0, 1\n for _ in range(n):\n print(a)\n a, b = b, a + b"}]} | |
| {"messages":[{"role":"user","content":"How can I calculate factorial recursively in Java?"},{"role":"assistant","content":"int factorial(int n) {\n if (n == 0) return 1;\n return n * factorial(n - 1);\n}"}]} | |
| {"messages":[{"role":"user","content":"I want to determine if a number is even using JavaScript."},{"role":"assistant","content":"const isEven = n => n % 2 === 0;"}]} | |
| {"messages":[{"role":"user","content":"Show me how to merge two Python lists together."},{"role":"assistant","content":"merged = list1 + list2"}]} | |
| {"messages":[{"role":"user","content":"How do I find duplicate email addresses using SQL?"},{"role":"assistant","content":"SELECT email, COUNT(*) FROM users GROUP BY email HAVING COUNT(*) > 1;"}]} | |
| {"messages":[{"role":"user","content":"I need a recursive factorial function in C#."},{"role":"assistant","content":"int Factorial(int n) {\n if (n == 0) return 1;\n return n * Factorial(n - 1);\n}"}]} | |
| {"messages":[{"role":"user","content":"Please show me how to compute factorial in Go using recursion."},{"role":"assistant","content":"func factorial(n int) int {\n if n == 0 {\n return 1\n }\n return n * factorial(n - 1)\n}"}]} | |
| {"messages":[{"role":"user","content":"I want to check if a string is a palindrome in Python."},{"role":"assistant","content":"def is_palindrome(s):\n return s == s[::-1]"}]} | |
| {"messages":[{"role":"user","content":"Show me a JavaScript function that checks for palindrome strings."},{"role":"assistant","content":"const isPalindrome = s => s === s.split('').reverse().join('');"}]} | |
| {"messages":[{"role":"user","content":"I want to determine if a number is even in Rust."},{"role":"assistant","content":"fn is_even(n: i32) -> bool {\n n % 2 == 0\n}"}]} | |
| {"messages":[{"role":"user","content":"I need a C++ function that checks if a number is prime."},{"role":"assistant","content":"bool isPrime(int n) {\n if (n < 2) return false;\n for (int i = 2; i * i <= n; i++) {\n if (n % i == 0) return false;\n }\n return true;\n}"}]} | |
| {"messages":[{"role":"user","content":"How can I find the maximum of three numbers in Python?"},{"role":"assistant","content":"max(a, b, c)"}]} | |
| {"messages":[{"role":"user","content":"Show me how to reverse a string in Java."},{"role":"assistant","content":"boolean isPalindrome(String s) {\n return new StringBuilder(s).reverse().toString().equals(s);\n}"}]} | |
| {"messages":[{"role":"user","content":"I want to reverse a string using Go."},{"role":"assistant","content":"func reverse(s string) string {\n r := []rune(s)\n for i, j := 0, len(r)-1; i < j; i, j = i+1, j-1 {\n r[i], r[j] = r[j], r[i]\n }\n return string(r)\n}"}]} | |
| {"messages":[{"role":"user","content":"Please show me how to get the maximum salary from a SQL table."},{"role":"assistant","content":"SELECT MAX(salary) FROM employees;"}]} | |
| {"messages":[{"role":"user","content":"I want to merge two dictionaries in Python."},{"role":"assistant","content":"merged = {**dict1, **dict2}"}]} | |
| {"messages":[{"role":"user","content":"How can I remove an item from a JavaScript array?"},{"role":"assistant","content":"arr = arr.filter(x => x !== item);"}]} | |
| {"messages":[{"role":"user","content":"I need to sum an array in Rust."},{"role":"assistant","content":"fn sum(arr: &[i32]) -> i32 {\n arr.iter().sum()\n}"}]} | |
| {"messages":[{"role":"user","content":"Show me how to sum an array in C#."},{"role":"assistant","content":"int sum = arr.Sum();"}]} | |
| {"messages":[{"role":"user","content":"I want to count vowels in a Python string."},{"role":"assistant","content":"def count_vowels(s):\n return sum(1 for c in s.lower() if c in 'aeiou')"}]} | |
| {"messages":[{"role":"user","content":"How can I count vowels using Java streams?"},{"role":"assistant","content":"long count = s.chars().filter(c -> \"aeiou\".indexOf(c) != -1).count();"}]} | |
| {"messages":[{"role":"user","content":"I want to calculate factorial iteratively in Go."},{"role":"assistant","content":"func factorial(n int) int {\n result := 1\n for i := 2; i <= n; i++ {\n result *= i\n }\n return result\n}"}]} | |
| {"messages":[{"role":"user","content":"Show me how to calculate average salary using SQL."},{"role":"assistant","content":"SELECT AVG(salary) FROM employees;"}]} | |
| {"messages":[{"role":"user","content":"I need to find the minimum value in a Python list."},{"role":"assistant","content":"min(my_list)"}]} | |
| {"messages":[{"role":"user","content":"How can I find the maximum value in a JavaScript array?"},{"role":"assistant","content":"Math.max(...arr)"}]} | |
| {"messages":[{"role":"user","content":"I want to get the length of a string in Rust."},{"role":"assistant","content":"let len = s.len();"}]} | |
| {"messages":[{"role":"user","content":"Show me how to get string length in C++."},{"role":"assistant","content":"int len = str.length();"}]} | |
| {"messages":[{"role":"user","content":"I want to square every number in a Python list."},{"role":"assistant","content":"list(map(lambda x: x*x, my_list))"}]} | |
| {"messages":[{"role":"user","content":"How can I sum an array using Java streams?"},{"role":"assistant","content":"int sum = Arrays.stream(arr).sum();"}]} | |
| {"messages":[{"role":"user","content":"I want to create a map in Go with string keys and integer values."},{"role":"assistant","content":"m := map[string]int{\"a\": 1, \"b\": 2}"}]} | |
| {"messages":[{"role":"user","content":"Show me how to join two tables in SQL."},{"role":"assistant","content":"SELECT * FROM a JOIN b ON a.id = b.id;"}]} | |
| {"messages":[{"role":"user","content":"I want to flatten a nested list in Python."},{"role":"assistant","content":"[item for sublist in list_of_lists for item in sublist]"}]} | |
| {"messages":[{"role":"user","content":"How can I flatten an array in JavaScript?"},{"role":"assistant","content":"arr.flat()"}]} | |
| {"messages":[{"role":"user","content":"Print hello world using Rust."},{"role":"assistant","content":"println!(\"Hello\");"}]} | |
| {"messages":[{"role":"user","content":"I want to reverse a string in C#."},{"role":"assistant","content":"new string(s.Reverse().ToArray());"}]} | |
| {"messages":[{"role":"user","content":"Generate a list of numbers from 0 to 9 in Python."},{"role":"assistant","content":"list(range(10))"}]} | |
| {"messages":[{"role":"user","content":"Show me how to reverse a string in Java."},{"role":"assistant","content":"new StringBuilder(s).reverse().toString();"}]} | |
| {"messages":[{"role":"user","content":"I want to handle errors in Go properly."},{"role":"assistant","content":"if err != nil {\n log.Fatal(err)\n}"}]} | |
| {"messages":[{"role":"user","content":"How can I delete duplicate rows in SQL?"},{"role":"assistant","content":"DELETE FROM users WHERE id NOT IN (SELECT MIN(id) FROM users GROUP BY email);"}]} | |
| {"messages":[{"role":"user","content":"I want to zip two lists in Python."},{"role":"assistant","content":"list(zip(list1, list2))"}]} | |
| {"messages":[{"role":"user","content":"Show me how to sort an array in JavaScript."},{"role":"assistant","content":"arr.sort((a, b) => a - b);"}]} | |
| {"messages":[{"role":"user","content":"I want to push a value into a Rust vector."},{"role":"assistant","content":"vec.push(10);"}]} | |
| {"messages":[{"role":"user","content":"Show me how to push an element into a C++ vector."},{"role":"assistant","content":"v.push_back(10);"}]} | |
| {"messages":[{"role":"user","content":"I want to check if a Python list is sorted."},{"role":"assistant","content":"def is_sorted(lst):\n return lst == sorted(lst)"}]} | |
| {"messages":[{"role":"user","content":"I want to check if a JavaScript array contains a value."},{"role":"assistant","content":"arr.includes(value)"}]} | |
| {"messages":[{"role":"user","content":"Show me how to reverse a slice in Go."},{"role":"assistant","content":"for i, j := 0, len(arr)-1; i < j; i, j = i+1, j-1 {\n arr[i], arr[j] = arr[j], arr[i]\n}"}]} | |
| {"messages":[{"role":"user","content":"I want to check if a string contains text in Rust."},{"role":"assistant","content":"s.contains(\"text\")"}]} | |
| {"messages":[{"role":"user","content":"Show me how to check if a C++ vector is empty."},{"role":"assistant","content":"if (v.empty()) {\n // empty\n}"}]} | |
| {"messages":[{"role":"user","content":"I want to compute the sum of a list in Python."},{"role":"assistant","content":"sum(my_list)"}]} | |
| {"messages":[{"role":"user","content":"I want to check for null values in Java."},{"role":"assistant","content":"if (obj == null) {\n // handle\n}"}]} | |
| {"messages":[{"role":"user","content":"Show me how to order SQL results by salary descending."},{"role":"assistant","content":"SELECT * FROM employees ORDER BY salary DESC;"}]} | |
| {"messages":[{"role":"user","content":"I want to convert a string to uppercase in JavaScript."},{"role":"assistant","content":"str.toUpperCase()"}]} | |
| {"messages":[{"role":"user","content":"I want to convert a string to lowercase in Python."},{"role":"assistant","content":"str.lower()"}]} | |
| {"messages":[{"role":"user","content":"Show me how to convert a string to int in Go."},{"role":"assistant","content":"i, _ := strconv.Atoi(str)"}]} | |
| {"messages":[{"role":"user","content":"I want to parse a string into an integer in Rust."},{"role":"assistant","content":"let num: i32 = s.parse().unwrap();"}]} | |
| {"messages":[{"role":"user","content":"Show me how to convert an int to string in C#."},{"role":"assistant","content":"x.ToString();"}]} | |
| {"messages":[{"role":"user","content":"I want to get the absolute value in Python."},{"role":"assistant","content":"abs(x)"}]} | |
| {"messages":[{"role":"user","content":"Show me absolute value in JavaScript."},{"role":"assistant","content":"Math.abs(x)"}]} | |
| {"messages":[{"role":"user","content":"I want to get absolute value in Java."},{"role":"assistant","content":"Math.abs(x);"}]} | |
| {"messages":[{"role":"user","content":"Show me how to loop through a range in Python."},{"role":"assistant","content":"for i in range(10):\n print(i)"}]} | |
| {"messages":[{"role":"user","content":"I want to loop in Go."},{"role":"assistant","content":"for i := 0; i < 10; i++ {\n fmt.Println(i)\n}"}]} | |
| {"messages":[{"role":"user","content":"Show me how to break a loop in Rust."},{"role":"assistant","content":"for i in 0..10 {\n if i == 5 {\n break;\n }\n}"}]} | |
| {"messages":[{"role":"user","content":"I want a for loop in C++."},{"role":"assistant","content":"for (int i = 0; i < 10; i++) {\n cout << i;\n}"}]} | |
| {"messages":[{"role":"user","content":"Show me how to enumerate a list in Python."},{"role":"assistant","content":"for i, v in enumerate(my_list):\n print(i, v)"}]} | |
| {"messages":[{"role":"user","content":"I want to use forEach in JavaScript."},{"role":"assistant","content":"arr.forEach(x => console.log(x));"}]} | |
| {"messages":[{"role":"user","content":"Show me how to select distinct values in SQL."},{"role":"assistant","content":"SELECT DISTINCT column_name FROM table;"}]} | |
| {"messages":[{"role":"user","content":"I want to get dictionary keys in Python."},{"role":"assistant","content":"my_dict.keys()"}]} | |
| {"messages":[{"role":"user","content":"Show me how to create a HashMap in Java."},{"role":"assistant","content":"Map<String, Integer> map = new HashMap<>();"}]} | |
| {"messages":[{"role":"user","content":"I want to append to a slice in Go."},{"role":"assistant","content":"arr = append(arr, 10)"}]} | |
| {"messages":[{"role":"user","content":"Show me how to get vector length in Rust."},{"role":"assistant","content":"vec.len()"}]} | |
| {"messages":[{"role":"user","content":"I want to add an item to a C# list."},{"role":"assistant","content":"list.Add(item);"}]} | |
| {"messages":[{"role":"user","content":"Show me how to check if a key exists in a Python dictionary."},{"role":"assistant","content":"key in my_dict"}]} | |
| {"messages":[{"role":"user","content":"I want to get object keys in JavaScript."},{"role":"assistant","content":"Object.keys(obj)"}]} | |
| {"messages":[{"role":"user","content":"Show me how to create a SQL table."},{"role":"assistant","content":"CREATE TABLE users (id INT, name TEXT);"}]} | |
| {"messages":[{"role":"user","content":"I want to zip two lists in Python again."},{"role":"assistant","content":"list(zip(a, b))"}]} | |
| {"messages":[{"role":"user","content":"Show me how to check a map key in Go."},{"role":"assistant","content":"val, ok := m[key]"}]} | |
| {"messages":[{"role":"user","content":"I want to use if let in Rust."},{"role":"assistant","content":"if let Some(x) = option {\n println!(\"{}\", x);\n}"}]} | |
| {"messages":[{"role":"user","content":"Show me an if statement in C++."},{"role":"assistant","content":"if (x > 0) {\n cout << x;\n}"}]} | |
| {"messages":[{"role":"user","content":"I want to raise an error in Python."},{"role":"assistant","content":"raise ValueError(\"error\")"}]} | |
| {"messages":[{"role":"user","content":"Show me how to throw an error in JavaScript."},{"role":"assistant","content":"throw new Error('error');"}]} | |
| {"messages":[{"role":"user","content":"I want to throw an exception in Java."},{"role":"assistant","content":"throw new Exception(\"error\");"}]} | |
| {"messages":[{"role":"user","content":"Show me SQL group by usage."},{"role":"assistant","content":"SELECT department, COUNT(*) FROM employees GROUP BY department;"}]} | |
| {"messages":[{"role":"user","content":"I want to filter an array in JavaScript."},{"role":"assistant","content":"arr.filter(x => x > 0)"}]} | |
| {"messages":[{"role":"user","content":"Show me reduce in JavaScript."},{"role":"assistant","content":"arr.reduce((a, b) => a + b, 0)"}]} | |
| {"messages":[{"role":"user","content":"I want to initialize a struct in Go."},{"role":"assistant","content":"p := Person{Name: \"John\"}"}]} | |
| {"messages":[{"role":"user","content":"Show me a struct in Rust."},{"role":"assistant","content":"struct Person {\n name: String,\n}"}]} | |
| {"messages":[{"role":"user","content":"I want to define a class in C#."},{"role":"assistant","content":"class Person {\n public string Name;\n}"}]} | |
| {"messages":[{"role":"user","content":"Show me how to create a set in Python."},{"role":"assistant","content":"my_set = {1, 2, 3}"}]} | |
| {"messages":[{"role":"user","content":"I want to create a set in Java."},{"role":"assistant","content":"Set<Integer> set = new HashSet<>();"}]} | |
| {"messages":[{"role":"user","content":"Show me a set in JavaScript."},{"role":"assistant","content":"const set = new Set([1,2,3]);"}]} | |
| {"messages":[{"role":"user","content":"I want to limit SQL results."},{"role":"assistant","content":"SELECT * FROM users LIMIT 10;"}]} | |
| {"messages":[{"role":"user","content":"Show me how to check empty string in Python."},{"role":"assistant","content":"if not s:\n print(\"empty\")"}]} | |
| {"messages":[{"role":"user","content":"I want to handle errors in Go."},{"role":"assistant","content":"if err != nil {\n log.Fatal(err)\n}"}]} | |
| {"messages":[{"role":"user","content":"Show me error handling in Rust."},{"role":"assistant","content":"match result {\n Ok(v) => v,\n Err(e) => panic!(\"error\"),\n}"}]} | |
| {"messages":[{"role":"user","content":"I need a Python example that checks whether a string is empty or not."},{"role":"assistant","content":"if not s:\n print(\"string is empty\")"}]} | |
| {"messages":[{"role":"user","content":"Show me how to find the length of a list in Python using built-in functions."},{"role":"assistant","content":"len(my_list)"}]} | |
| {"messages":[{"role":"user","content":"I want a JavaScript example for checking if an array is empty."},{"role":"assistant","content":"arr.length === 0"}]} | |
| {"messages":[{"role":"user","content":"Can you demonstrate how to convert a string to an integer in Python?"},{"role":"assistant","content":"int(s)"}]} | |
| {"messages":[{"role":"user","content":"I need a Rust snippet that parses a string into an integer safely."},{"role":"assistant","content":"let num: i32 = s.parse().unwrap();"}]} | |
| {"messages":[{"role":"user","content":"Show me how to compute the absolute value of a number in JavaScript."},{"role":"assistant","content":"Math.abs(x)"}]} | |
| {"messages":[{"role":"user","content":"I want to loop over a list in Python and print each element."},{"role":"assistant","content":"for item in my_list:\n print(item)"}]} | |
| {"messages":[{"role":"user","content":"Demonstrate how to create an empty dictionary in Python."},{"role":"assistant","content":"my_dict = {}"}]} | |
| {"messages":[{"role":"user","content":"I need a SQL query that selects all records from a table."},{"role":"assistant","content":"SELECT * FROM table_name;"}]} | |
| {"messages":[{"role":"user","content":"Show me how to sort a list in Python in ascending order."},{"role":"assistant","content":"sorted(my_list)"}]} | |
| {"messages":[{"role":"user","content":"I want a Java example that checks if a string is null."},{"role":"assistant","content":"if (s == null) {\n // handle null\n}"}]} | |
| {"messages":[{"role":"user","content":"How can I reverse a list in Python without using reverse()?."},{"role":"assistant","content":"my_list[::-1]"}]} | |
| {"messages":[{"role":"user","content":"Show me how to append an element to a Python list."},{"role":"assistant","content":"my_list.append(10)"}]} | |
| {"messages":[{"role":"user","content":"I need a Go example for iterating over a slice."},{"role":"assistant","content":"for i, v := range arr {\n fmt.Println(i, v)\n}"}]} | |
| {"messages":[{"role":"user","content":"Demonstrate how to check if a number is negative in Python."},{"role":"assistant","content":"n < 0"}]} | |
| {"messages":[{"role":"user","content":"I want a C++ example for declaring an array."},{"role":"assistant","content":"int arr[5] = {1,2,3,4,5};"}]} | |
| {"messages":[{"role":"user","content":"Show me how to concatenate strings in Python."},{"role":"assistant","content":"a + b"}]} | |
| {"messages":[{"role":"user","content":"I need a JavaScript way to convert a string to lowercase."},{"role":"assistant","content":"str.toLowerCase()"}]} | |
| {"messages":[{"role":"user","content":"How do I generate a random number in Python?"},{"role":"assistant","content":"import random\nrandom.randint(1, 100)"}]} | |
| {"messages":[{"role":"user","content":"I want to check if a list contains a value in Python."},{"role":"assistant","content":"value in my_list"}]} | |
| {"messages":[{"role":"user","content":"Show me how to remove whitespace from a string in Python."},{"role":"assistant","content":"s.strip()"}]} | |
| {"messages":[{"role":"user","content":"I need a Java example for creating a list."},{"role":"assistant","content":"List<Integer> list = new ArrayList<>();"}]} | |
| {"messages":[{"role":"user","content":"Show me how to get the first element of a list in Python."},{"role":"assistant","content":"my_list[0]"}]} | |
| {"messages":[{"role":"user","content":"I want a Rust example for checking if a vector is empty."},{"role":"assistant","content":"vec.is_empty()"}]} | |
| {"messages":[{"role":"user","content":"Show me how to define a function in Python that adds two numbers."},{"role":"assistant","content":"def add(a, b):\n return a + b"}]} | |
| {"messages":[{"role":"user","content":"I need a JavaScript function that multiplies two numbers."},{"role":"assistant","content":"function multiply(a, b) {\n return a * b;\n}"}]} | |
| {"messages":[{"role":"user","content":"Show me how to calculate power in Python using built-in operators."},{"role":"assistant","content":"a ** b"}]} | |
| {"messages":[{"role":"user","content":"I want a Go example for checking if a map contains a key."},{"role":"assistant","content":"value, ok := m[key]"}]} | |
| {"messages":[{"role":"user","content":"Show me how to format a string in Python using f-strings."},{"role":"assistant","content":"f\"Hello {name}\""}]} | |
| {"messages":[{"role":"user","content":"I need a SQL query that counts rows in a table."},{"role":"assistant","content":"SELECT COUNT(*) FROM table_name;"}]} | |
| {"messages":[{"role":"user","content":"Show me how to convert a list to a set in Python."},{"role":"assistant","content":"set(my_list)"}]} | |
| {"messages":[{"role":"user","content":"I want a Java example for looping through an array."},{"role":"assistant","content":"for (int i = 0; i < arr.length; i++) {\n System.out.println(arr[i]);\n}"}]} | |
| {"messages":[{"role":"user","content":"Show me how to check if a string contains a substring in JavaScript."},{"role":"assistant","content":"s.includes(\"text\")"}]} | |
| {"messages":[{"role":"user","content":"I need a Python example that finds the max value in a list."},{"role":"assistant","content":"max(my_list)"}]} | |
| {"messages":[{"role":"user","content":"Show me how to remove an element from a Python list by value."},{"role":"assistant","content":"my_list.remove(value)"}]} | |
| {"messages":[{"role":"user","content":"I want a C# example for creating a list of strings."},{"role":"assistant","content":"List<string> list = new List<string>();"}]} | |
| {"messages":[{"role":"user","content":"Show me how to check if a number is zero in Python."},{"role":"assistant","content":"n == 0"}]} | |
| {"messages":[{"role":"user","content":"I need a Go example for printing to console."},{"role":"assistant","content":"fmt.Println(\"Hello\")"}]} | |
| {"messages":[{"role":"user","content":"Show me how to convert a string to uppercase in Python."},{"role":"assistant","content":"s.upper()"}]} | |
| {"messages":[{"role":"user","content":"I want a JavaScript example for filtering an array."},{"role":"assistant","content":"arr.filter(x => x > 0)"}]} | |
| {"messages":[{"role":"user","content":"Show me how to compute factorial using a loop in Python."},{"role":"assistant","content":"result = 1\nfor i in range(1, n+1):\n result *= i"}]} | |
| {"messages":[{"role":"user","content":"I need a Rust example for pushing to a vector."},{"role":"assistant","content":"vec.push(10);"}]} | |
| {"messages":[{"role":"user","content":"Show me how to get dictionary keys in Python."},{"role":"assistant","content":"my_dict.keys()"}]} | |
| {"messages":[{"role":"user","content":"I want a SQL query that selects distinct values."},{"role":"assistant","content":"SELECT DISTINCT column_name FROM table_name;"}]} | |
| {"messages":[{"role":"user","content":"Show me how to reverse a string in Python using slicing."},{"role":"assistant","content":"s[::-1]"}]} | |
| {"messages":[{"role":"user","content":"I need a Java example for checking null values."},{"role":"assistant","content":"if (obj == null) {\n // handle\n}"}]} | |
| {"messages":[{"role":"user","content":"Show me how to join two lists in Python."},{"role":"assistant","content":"list1 + list2"}]} | |
| {"messages":[{"role":"user","content":"I want a Go example for creating a struct."},{"role":"assistant","content":"type Person struct {\n Name string\n}"}]} | |
| {"messages":[{"role":"user","content":"Show me how to check if a string starts with a prefix in Python."},{"role":"assistant","content":"s.startswith(\"abc\")"}]} | |
| {"messages":[{"role":"user","content":"I want to check if a Python set contains a specific element."},{"role":"assistant","content":"element in my_set"}]} | |
| {"messages":[{"role":"user","content":"Show me how to create an empty list in Python."},{"role":"assistant","content":"my_list = []"}]} | |
| {"messages":[{"role":"user","content":"I need a JavaScript example for adding an item to an array."},{"role":"assistant","content":"arr.push(item);"}]} | |
| {"messages":[{"role":"user","content":"How can I find the minimum value in a JavaScript array?"},{"role":"assistant","content":"Math.min(...arr)"}]} | |
| {"messages":[{"role":"user","content":"I want a Python example that checks if a number is greater than zero."},{"role":"assistant","content":"n > 0"}]} | |
| {"messages":[{"role":"user","content":"Show me how to convert an integer to a string in Python."},{"role":"assistant","content":"str(n)"}]} | |
| {"messages":[{"role":"user","content":"I need a Rust example for printing a variable to the console."},{"role":"assistant","content":"println!(\"{}\", value);"}]} | |
| {"messages":[{"role":"user","content":"Show me how to remove an item from a Python set."},{"role":"assistant","content":"my_set.remove(value)"}]} | |
| {"messages":[{"role":"user","content":"I want a SQL query that selects rows where a column is not null."},{"role":"assistant","content":"SELECT * FROM table_name WHERE column_name IS NOT NULL;"}]} | |
| {"messages":[{"role":"user","content":"Show me how to find the length of a dictionary in Python."},{"role":"assistant","content":"len(my_dict)"}]} | |
| {"messages":[{"role":"user","content":"I need a Go example for creating an empty slice."},{"role":"assistant","content":"var arr []int"}]} | |
| {"messages":[{"role":"user","content":"Show me how to check if a string contains a substring in Python."},{"role":"assistant","content":"substring in s"}]} | |
| {"messages":[{"role":"user","content":"I want a Java example for converting a string to uppercase."},{"role":"assistant","content":"s.toUpperCase();"}]} | |
| {"messages":[{"role":"user","content":"Show me how to calculate the square root in Python."},{"role":"assistant","content":"import math\nmath.sqrt(x)"}]} | |
| {"messages":[{"role":"user","content":"I need a JavaScript function that returns the square of a number."},{"role":"assistant","content":"const square = x => x * x;"}]} | |
| {"messages":[{"role":"user","content":"Show me how to iterate through a dictionary in Python."},{"role":"assistant","content":"for k, v in my_dict.items():\n print(k, v)"}]} | |
| {"messages":[{"role":"user","content":"I want a C++ example for checking if a number is positive."},{"role":"assistant","content":"if (n > 0) {\n cout << \"positive\";\n}"}]} | |
| {"messages":[{"role":"user","content":"Show me how to convert a string to lowercase in JavaScript."},{"role":"assistant","content":"str.toLowerCase()"}]} | |
| {"messages":[{"role":"user","content":"I need a Python example that checks if a list is empty."},{"role":"assistant","content":"len(my_list) == 0"}]} | |
| {"messages":[{"role":"user","content":"Show me how to append multiple values to a list in Python."},{"role":"assistant","content":"my_list.extend([1,2,3])"}]} | |
| {"messages":[{"role":"user","content":"I want a Go example for checking if a slice contains an element."},{"role":"assistant","content":"for _, v := range arr {\n if v == target {\n return true\n }\n}"}]} | |
| {"messages":[{"role":"user","content":"Show me how to create a tuple in Python."},{"role":"assistant","content":"my_tuple = (1, 2, 3)"}]} | |
| {"messages":[{"role":"user","content":"I need a Java example for comparing two strings."},{"role":"assistant","content":"s1.equals(s2)"}]} | |
| {"messages":[{"role":"user","content":"Show me how to generate a random float in Python."},{"role":"assistant","content":"import random\nrandom.random()"}]} | |
| {"messages":[{"role":"user","content":"I want a Rust example for checking if an option is None."},{"role":"assistant","content":"if option.is_none() {\n println!(\"None value\");\n}"}]} | |
| {"messages":[{"role":"user","content":"Show me how to replace a substring in Python."},{"role":"assistant","content":"s.replace(\"old\", \"new\")"}]} | |
| {"messages":[{"role":"user","content":"I need a SQL query that updates a column value."},{"role":"assistant","content":"UPDATE table_name SET column_name = value WHERE condition;"}]} | |
| {"messages":[{"role":"user","content":"Show me how to check if a number is odd in Python."},{"role":"assistant","content":"n % 2 != 0"}]} | |
| {"messages":[{"role":"user","content":"I want a JavaScript example for reversing an array."},{"role":"assistant","content":"arr.reverse()"}]} | |
| {"messages":[{"role":"user","content":"Show me how to calculate exponentiation in Python."},{"role":"assistant","content":"pow(a, b)"}]} | |
| {"messages":[{"role":"user","content":"I need a Go example for formatting strings."},{"role":"assistant","content":"fmt.Sprintf(\"Hello %s\", name)"}]} | |
| {"messages":[{"role":"user","content":"Show me how to create a dictionary with default values in Python."},{"role":"assistant","content":"from collections import defaultdict\nd = defaultdict(int)"}]} | |
| {"messages":[{"role":"user","content":"I want a C# example for checking if a list contains an item."},{"role":"assistant","content":"list.Contains(item)"}]} | |
| {"messages":[{"role":"user","content":"Show me how to remove duplicates from a list in Python."},{"role":"assistant","content":"list(set(my_list))"}]} | |
| {"messages":[{"role":"user","content":"I need a Java example for parsing integers."},{"role":"assistant","content":"int n = Integer.parseInt(str);"}]} | |
| {"messages":[{"role":"user","content":"Show me how to check if a string is numeric in Python."},{"role":"assistant","content":"s.isdigit()"}]} | |
| {"messages":[{"role":"user","content":"I want a Rust example for iterating over a vector."},{"role":"assistant","content":"for v in vec {\n println!(\"{}\", v);\n}"}]} | |
| {"messages":[{"role":"user","content":"Show me how to join strings in JavaScript."},{"role":"assistant","content":"[\"a\",\"b\"].join(\"\")"}]} | |
| {"messages":[{"role":"user","content":"I need a SQL query that deletes a row by id."},{"role":"assistant","content":"DELETE FROM table_name WHERE id = 1;"}]} | |
| {"messages":[{"role":"user","content":"Show me how to check if a list contains duplicates in Python."},{"role":"assistant","content":"len(my_list) != len(set(my_list))"}]} | |
| {"messages":[{"role":"user","content":"I want a Go example for converting int to string."},{"role":"assistant","content":"strconv.Itoa(n)"}]} | |
| {"messages":[{"role":"user","content":"Show me how to split a string in Python."},{"role":"assistant","content":"s.split(\" \")"}]} | |
| {"messages":[{"role":"user","content":"I need a JavaScript example for checking truthy values."},{"role":"assistant","content":"if (value) {\n console.log(\"truthy\");\n}"}]} | |
| {"messages":[{"role":"user","content":"Show me how to calculate factorial recursively in Python."},{"role":"assistant","content":"def factorial(n):\n if n == 0:\n return 1\n return n * factorial(n - 1)"}]} | |
| {"messages":[{"role":"user","content":"I want a C++ example for returning a boolean function."},{"role":"assistant","content":"bool check(int n) {\n return n > 0;\n}"}]} | |
| {"messages":[{"role":"user","content":"Show me how to access object properties in JavaScript."},{"role":"assistant","content":"obj.property"}]} | |
| {"messages":[{"role":"user","content":"I need a Python example for checking file existence."},{"role":"assistant","content":"import os\nos.path.exists(\"file.txt\")"}]} | |
| {"messages":[{"role":"user","content":"Show me how to round a number in Python."},{"role":"assistant","content":"round(x)"}]} | |
| {"messages":[{"role":"user","content":"I want a Rust example for matching a number."},{"role":"assistant","content":"match n {\n 1 => println!(\"one\"),\n _ => println!(\"other\"),\n}"}]} | |
| {"messages":[{"role":"user","content":"Show me how to convert a string to float in Python."},{"role":"assistant","content":"float(s)"}]} | |
| {"messages":[{"role":"user","content":"I need a Java example for trimming whitespace."},{"role":"assistant","content":"s.trim();"}]} |