Download data.jsonl from wafee-ops/coding: direct link, hf CLI and curl.
- Browser
- Download file 40.8 kB
-
https://huggingface.co/datasets/wafee-ops/coding/resolve/3a68d40f4ea0ca9dd728d4505da9f27a69f3e0df/data.jsonl
- Command line
-
hf download hf://datasets/wafee-ops/coding@3a68d40f4ea0ca9dd728d4505da9f27a69f3e0df/data.jsonl
-
curl -L -o data.jsonl https://huggingface.co/datasets/wafee-ops/coding/resolve/3a68d40f4ea0ca9dd728d4505da9f27a69f3e0df/data.jsonl
40.8 kB
| {"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();"}]} | |
| {"messages":[{"role":"user","content":"I want to check if a Python dictionary is empty or not."},{"role":"assistant","content":"len(my_dict) == 0"}]} | |
| {"messages":[{"role":"user","content":"Show me how to get the last element of a list in Python."},{"role":"assistant","content":"my_list[-1]"}]} | |
| {"messages":[{"role":"user","content":"I need a JavaScript example for checking if a variable is undefined."},{"role":"assistant","content":"typeof x === \"undefined\""}]} | |
| {"messages":[{"role":"user","content":"Show me how to convert Celsius to Fahrenheit in Python."},{"role":"assistant","content":"(c * 9/5) + 32"}]} | |
| {"messages":[{"role":"user","content":"I want a Go example for converting a string to uppercase."},{"role":"assistant","content":"strings.ToUpper(s)"}]} | |
| {"messages":[{"role":"user","content":"Show me how to check if a number is within a range in Python."},{"role":"assistant","content":"0 <= n <= 10"}]} | |
| {"messages":[{"role":"user","content":"I need a Rust example for checking string equality."},{"role":"assistant","content":"if s1 == s2 {\n println!(\"equal\");\n}"}]} | |
| {"messages":[{"role":"user","content":"Show me how to create a list of squares in Python."},{"role":"assistant","content":"[x*x for x in range(10)]"}]} | |
| {"messages":[{"role":"user","content":"I want a SQL query that finds the second highest salary."},{"role":"assistant","content":"SELECT MAX(salary) FROM employees WHERE salary < (SELECT MAX(salary) FROM employees);"}]} | |
| {"messages":[{"role":"user","content":"Show me how to check if a string is uppercase in Python."},{"role":"assistant","content":"s.isupper()"}]} | |
| {"messages":[{"role":"user","content":"I need a Java example for splitting a string."},{"role":"assistant","content":"s.split(\" \");"}]} | |
| {"messages":[{"role":"user","content":"Show me how to calculate modulo in JavaScript."},{"role":"assistant","content":"a % b"}]} | |
| {"messages":[{"role":"user","content":"I want a Python example for checking even numbers using bitwise operators."},{"role":"assistant","content":"n & 1 == 0"}]} | |
| {"messages":[{"role":"user","content":"Show me how to initialize an empty set in Python."},{"role":"assistant","content":"set()"}]} | |
| {"messages":[{"role":"user","content":"I need a C++ example for swapping two variables."},{"role":"assistant","content":"swap(a, b);"}]} | |
| {"messages":[{"role":"user","content":"Show me how to convert a string to a boolean in Python."},{"role":"assistant","content":"bool(s)"}]} | |
| {"messages":[{"role":"user","content":"I want a Go example for checking string length."},{"role":"assistant","content":"len(s)"}]} | |
| {"messages":[{"role":"user","content":"Show me how to calculate factorial using recursion in JavaScript."},{"role":"assistant","content":"function factorial(n) {\n if (n === 0) return 1;\n return n * factorial(n - 1);\n}"}]} | |
| {"messages":[{"role":"user","content":"I need a Python example for merging two sets."},{"role":"assistant","content":"set1 | set2"}]} | |
| {"messages":[{"role":"user","content":"Show me how to remove duplicates from a string in Python."},{"role":"assistant","content":"\"\".join(set(s))"}]} | |
| {"messages":[{"role":"user","content":"I want a Java example for checking array length."},{"role":"assistant","content":"arr.length"}]} | |
| {"messages":[{"role":"user","content":"Show me how to check if a number is divisible by 3 in Python."},{"role":"assistant","content":"n % 3 == 0"}]} | |
| {"messages":[{"role":"user","content":"I need a Rust example for converting integer to float."},{"role":"assistant","content":"let f = n as f64;"}]} | |
| {"messages":[{"role":"user","content":"Show me how to join a list into a string in Python."},{"role":"assistant","content":"\" \".join(my_list)"}]} | |
| {"messages":[{"role":"user","content":"I want a SQL query for selecting top 5 rows."},{"role":"assistant","content":"SELECT * FROM table_name LIMIT 5;"}]} | |
| {"messages":[{"role":"user","content":"Show me how to check if a list has even numbers in Python."},{"role":"assistant","content":"any(x % 2 == 0 for x in my_list)"}]} | |
| {"messages":[{"role":"user","content":"I need a JavaScript example for generating random integers."},{"role":"assistant","content":"Math.floor(Math.random() * 10)"}]} | |
| {"messages":[{"role":"user","content":"Show me how to calculate square root in JavaScript."},{"role":"assistant","content":"Math.sqrt(x)"}]} | |
| {"messages":[{"role":"user","content":"I want a Go example for appending to a slice dynamically."},{"role":"assistant","content":"arr = append(arr, value)"}]} | |
| {"messages":[{"role":"user","content":"Show me how to check if a string starts with a number in Python."},{"role":"assistant","content":"s[0].isdigit()"}]} | |
| {"messages":[{"role":"user","content":"I need a C# example for converting string to int safely."},{"role":"assistant","content":"int.TryParse(s, out int result);"}]} | |
| {"messages":[{"role":"user","content":"Show me how to compute exponent power in JavaScript."},{"role":"assistant","content":"Math.pow(a, b)"}]} | |
| {"messages":[{"role":"user","content":"I want a Python example for checking prime numbers using a loop."},{"role":"assistant","content":"def is_prime(n):\n if n < 2:\n return False\n for i in range(2, n):\n if n % i == 0:\n return False\n return True"}]} | |
| {"messages":[{"role":"user","content":"Show me how to remove whitespace from both ends of a string in JavaScript."},{"role":"assistant","content":"s.trim()"}]} | |
| {"messages":[{"role":"user","content":"I need a Rust example for creating a vector of integers."},{"role":"assistant","content":"let v = vec![1, 2, 3];"}]} | |
| {"messages":[{"role":"user","content":"Show me how to calculate average of a list in Python."},{"role":"assistant","content":"sum(my_list) / len(my_list)"}]} | |
| {"messages":[{"role":"user","content":"I want a Java example for converting integer to string."},{"role":"assistant","content":"String.valueOf(n);"}]} | |
| {"messages":[{"role":"user","content":"Show me how to check if a number is odd in JavaScript."},{"role":"assistant","content":"n % 2 !== 0"}]} | |
| {"messages":[{"role":"user","content":"I need a Python example for finding intersection of two sets."},{"role":"assistant","content":"set1 & set2"}]} | |
| {"messages":[{"role":"user","content":"Show me how to generate a list of even numbers in Python."},{"role":"assistant","content":"[x for x in range(20) if x % 2 == 0]"}]} | |
| {"messages":[{"role":"user","content":"I want a Go example for checking if a string is empty."},{"role":"assistant","content":"len(s) == 0"}]} | |
| {"messages":[{"role":"user","content":"Show me how to format decimal numbers in Python."},{"role":"assistant","content":"format(x, \".2f\")"}]} | |
| {"messages":[{"role":"user","content":"I need a SQL example for counting distinct values."},{"role":"assistant","content":"SELECT COUNT(DISTINCT column_name) FROM table_name;"}]} | |
| {"messages":[{"role":"user","content":"Show me how to create a constant in JavaScript."},{"role":"assistant","content":"const x = 10;"}]} | |
| {"messages":[{"role":"user","content":"I want a C++ example for checking string equality."},{"role":"assistant","content":"if (s1 == s2) {\n cout << \"equal\";\n}"}]} | |
| {"messages":[{"role":"user","content":"Show me how to reverse words in a sentence in Python."},{"role":"assistant","content":"\" \".join(sentence.split()[::-1])"}]} | |
| {"messages":[{"role":"user","content":"I need a Rust example for checking if a vector contains a value."},{"role":"assistant","content":"vec.contains(&value)"}]} | |
| {"messages":[{"role":"user","content":"Show me how to convert a list to a string in Python."},{"role":"assistant","content":"str(my_list)"}]} | |
| {"messages":[{"role":"user","content":"I want a JavaScript example for finding array length."},{"role":"assistant","content":"arr.length"}]} | |
| {"messages":[{"role":"user","content":"Show me how to calculate factorial using iteration in Python."},{"role":"assistant","content":"result = 1\nfor i in range(1, n+1):\n result *= i"}]} | |
| {"messages":[{"role":"user","content":"I want to check if a Python list contains only unique elements."},{"role":"assistant","content":"len(my_list) == len(set(my_list))"}]} | |
| {"messages":[{"role":"user","content":"Show me how to convert a string into a list of characters in Python."},{"role":"assistant","content":"list(s)"}]} | |
| {"messages":[{"role":"user","content":"I need a JavaScript example for checking if a number is finite."},{"role":"assistant","content":"Number.isFinite(n)"}]} | |
| {"messages":[{"role":"user","content":"Show me how to calculate the sum of digits in a number using Python."},{"role":"assistant","content":"sum(int(d) for d in str(n))"}]} | |
| {"messages":[{"role":"user","content":"I want a Go example for converting a float to an integer."},{"role":"assistant","content":"int(f)"}]} | |
| {"messages":[{"role":"user","content":"Show me how to check if a string is a palindrome ignoring case in Python."},{"role":"assistant","content":"s.lower() == s.lower()[::-1]"}]} | |
| {"messages":[{"role":"user","content":"I need a Rust example for checking if a number is positive."},{"role":"assistant","content":"n > 0"}]} | |
| {"messages":[{"role":"user","content":"Show me how to find the first element in a Python dictionary."},{"role":"assistant","content":"next(iter(my_dict))"}]} | |
| {"messages":[{"role":"user","content":"I want a SQL query that retrieves the latest record from a table."},{"role":"assistant","content":"SELECT * FROM table_name ORDER BY created_at DESC LIMIT 1;"}]} | |
| {"messages":[{"role":"user","content":"Show me how to check if a list is sorted in descending order in Python."},{"role":"assistant","content":"my_list == sorted(my_list, reverse=True)"}]} | |
| {"messages":[{"role":"user","content":"I need a Java example for reversing an integer array."},{"role":"assistant","content":"Collections.reverse(Arrays.asList(arr));"}]} | |
| {"messages":[{"role":"user","content":"Show me how to check if a string is numeric in JavaScript."},{"role":"assistant","content":"!isNaN(s)"}]} | |
| {"messages":[{"role":"user","content":"I want a Python example for removing all vowels from a string."},{"role":"assistant","content":"''.join(c for c in s if c.lower() not in 'aeiou')"}]} | |
| {"messages":[{"role":"user","content":"Show me how to find the maximum value in a dictionary in Python."},{"role":"assistant","content":"max(my_dict.values())"}]} | |
| {"messages":[{"role":"user","content":"I need a C++ example for checking if a string is empty."},{"role":"assistant","content":"if (s.empty()) {\n // empty\n}"}]} | |
| {"messages":[{"role":"user","content":"Show me how to generate a random choice from a list in Python."},{"role":"assistant","content":"import random\nrandom.choice(my_list)"}]} | |
| {"messages":[{"role":"user","content":"I want a Go example for converting int to string safely."},{"role":"assistant","content":"strconv.Itoa(n)"}]} | |
| {"messages":[{"role":"user","content":"Show me how to check if a number is a power of two in Python."},{"role":"assistant","content":"n > 0 and (n & (n - 1)) == 0"}]} | |
| {"messages":[{"role":"user","content":"I need a JavaScript example for rounding down a number."},{"role":"assistant","content":"Math.floor(x)"}]} | |
| {"messages":[{"role":"user","content":"Show me how to compute factorial using reduce in Python."},{"role":"assistant","content":"from functools import reduce\nreduce(lambda a, b: a*b, range(1, n+1), 1)"}]} | |
| {"messages":[{"role":"user","content":"I want a Rust example for checking if a string starts with a prefix."},{"role":"assistant","content":"s.starts_with(\"abc\")"}]} | |
| {"messages":[{"role":"user","content":"Show me how to split a string into words in Java."},{"role":"assistant","content":"s.split(\" \");"}]} | |
| {"messages":[{"role":"user","content":"I need a Python example for merging multiple dictionaries."},{"role":"assistant","content":"{**a, **b, **c}"}]} | |
| {"messages":[{"role":"user","content":"Show me how to calculate absolute difference in JavaScript."},{"role":"assistant","content":"Math.abs(a - b)"}]} | |
| {"messages":[{"role":"user","content":"I want a Go example for checking nil maps."},{"role":"assistant","content":"if m == nil {\n // handle\n}"}]} | |
| {"messages":[{"role":"user","content":"Show me how to remove duplicates from a list while preserving order in Python."},{"role":"assistant","content":"list(dict.fromkeys(my_list))"}]} | |
| {"messages":[{"role":"user","content":"I need a C# example for checking if a string contains a substring."},{"role":"assistant","content":"s.Contains(\"text\")"}]} | |
| {"messages":[{"role":"user","content":"Show me how to calculate the square of a number in Python."},{"role":"assistant","content":"x * x"}]} | |
| {"messages":[{"role":"user","content":"I want a SQL query that finds all users older than 30."},{"role":"assistant","content":"SELECT * FROM users WHERE age > 30;"}]} | |
| {"messages":[{"role":"user","content":"Show me how to reverse a linked list conceptually in Python."},{"role":"assistant","content":"prev = None\nwhile head:\n next_node = head.next\n head.next = prev\n prev = head\n head = next_node"}]} | |
| {"messages":[{"role":"user","content":"I need a Java example for checking array equality."},{"role":"assistant","content":"Arrays.equals(arr1, arr2);"}]} | |
| {"messages":[{"role":"user","content":"Show me how to generate a list of random numbers in Python."},{"role":"assistant","content":"import random\n[random.randint(1, 100) for _ in range(10)]"}]} | |
| {"messages":[{"role":"user","content":"I want a Rust example for converting float to string."},{"role":"assistant","content":"format!(\"{}\", f)"}]} | |
| {"messages":[{"role":"user","content":"Show me how to find the minimum value in a JavaScript array."},{"role":"assistant","content":"Math.min(...arr)"}]} | |
| {"messages":[{"role":"user","content":"I need a Python example for checking if all elements in a list are positive."},{"role":"assistant","content":"all(x > 0 for x in my_list)"}]} | |
| {"messages":[{"role":"user","content":"Show me how to remove the first element from a Python list."},{"role":"assistant","content":"my_list.pop(0)"}]} | |
| {"messages":[{"role":"user","content":"I want a Go example for iterating over a map."},{"role":"assistant","content":"for k, v := range m {\n fmt.Println(k, v)\n}"}]} | |
| {"messages":[{"role":"user","content":"Show me how to convert string to int in JavaScript."},{"role":"assistant","content":"parseInt(s)"}]} | |
| {"messages":[{"role":"user","content":"I need a Python example for checking if a string ends with a suffix."},{"role":"assistant","content":"s.endswith(\"abc\")"}]} | |
| {"messages":[{"role":"user","content":"Show me how to calculate the average of numbers in JavaScript."},{"role":"assistant","content":"arr.reduce((a, b) => a + b, 0) / arr.length"}]} | |
| {"messages":[{"role":"user","content":"I want a C++ example for finding maximum element in an array."},{"role":"assistant","content":"*max_element(arr, arr + n);"}]} | |
| {"messages":[{"role":"user","content":"Show me how to check if a Python set is a subset of another set."},{"role":"assistant","content":"set1.issubset(set2)"}]} | |
| {"messages":[{"role":"user","content":"I need a Java example for iterating over a list using enhanced for loop."},{"role":"assistant","content":"for (String s : list) {\n System.out.println(s);\n}"}]} | |
| {"messages":[{"role":"user","content":"Show me how to flatten a nested list using recursion in Python."},{"role":"assistant","content":"def flatten(lst):\n result = []\n for i in lst:\n if isinstance(i, list):\n result.extend(flatten(i))\n else:\n result.append(i)\n return result"}]} | |
| {"messages":[{"role":"user","content":"I want a Rust example for checking if a vector is sorted."},{"role":"assistant","content":"vec.windows(2).all(|w| w[0] <= w[1])"}]} | |
| {"messages":[{"role":"user","content":"Show me how to generate a Fibonacci sequence using recursion in Python."},{"role":"assistant","content":"def fib(n):\n if n <= 1:\n return n\n return fib(n-1) + fib(n-2)"}]} | |
| {"messages":[{"role":"user","content":"I need a JavaScript example for checking if a string is empty or whitespace."},{"role":"assistant","content":"!s.trim()"}]} | |
| {"messages":[{"role":"user","content":"Show me how to compute factorial using Python math library."},{"role":"assistant","content":"import math\nmath.factorial(n)"}]} | |
| {"messages":[{"role":"user","content":"I want a Python example that checks whether a number is divisible by 5."},{"role":"assistant","content":"n % 5 == 0"}]} | |
| {"messages":[{"role":"user","content":"Show me how to convert a list of integers to strings in Python."},{"role":"assistant","content":"list(map(str, my_list))"}]} | |
| {"messages":[{"role":"user","content":"I need a JavaScript example for checking if an array is not empty."},{"role":"assistant","content":"arr.length > 0"}]} | |
| {"messages":[{"role":"user","content":"Show me how to get the first key in a Python dictionary."},{"role":"assistant","content":"next(iter(my_dict))"}]} | |
| {"messages":[{"role":"user","content":"I want a Go example for checking if a slice is empty."},{"role":"assistant","content":"len(arr) == 0"}]} | |
| {"messages":[{"role":"user","content":"Show me how to convert Fahrenheit to Celsius in Python."},{"role":"assistant","content":"(f - 32) * 5/9"}]} | |
| {"messages":[{"role":"user","content":"I need a Rust example for checking if a string is empty."},{"role":"assistant","content":"s.is_empty()"}]} | |
| {"messages":[{"role":"user","content":"Show me how to find the index of an element in a Python list."},{"role":"assistant","content":"my_list.index(value)"}]} | |
| {"messages":[{"role":"user","content":"I want a SQL query that finds users with duplicate usernames."},{"role":"assistant","content":"SELECT username, COUNT(*) FROM users GROUP BY username HAVING COUNT(*) > 1;"}]} | |
| {"messages":[{"role":"user","content":"Show me how to check if a Python list contains a string."},{"role":"assistant","content":"\"text\" in my_list"}]} | |
| {"messages":[{"role":"user","content":"I need a Java example for checking if a number is even."},{"role":"assistant","content":"n % 2 == 0"}]} | |
| {"messages":[{"role":"user","content":"Show me how to reverse a string in Python without slicing."},{"role":"assistant","content":"''.join(reversed(s))"}]} | |
| {"messages":[{"role":"user","content":"I want a C++ example for finding the minimum element in an array."},{"role":"assistant","content":"*min_element(arr, arr + n);"}]} | |
| {"messages":[{"role":"user","content":"Show me how to generate random numbers in JavaScript between 0 and 1."},{"role":"assistant","content":"Math.random()"}]} | |
| {"messages":[{"role":"user","content":"I need a Python example for checking if a string is alphanumeric."},{"role":"assistant","content":"s.isalnum()"}]} | |
| {"messages":[{"role":"user","content":"Show me how to compute factorial using a while loop in Python."},{"role":"assistant","content":"result = 1\nwhile n > 1:\n result *= n\n n -= 1"}]} | |
| {"messages":[{"role":"user","content":"I want a Go example for converting a string to float."},{"role":"assistant","content":"strconv.ParseFloat(s, 64)"}]} | |
| {"messages":[{"role":"user","content":"Show me how to check if a number is negative in JavaScript."},{"role":"assistant","content":"n < 0"}]} | |
| {"messages":[{"role":"user","content":"I need a Rust example for printing all elements in a vector."},{"role":"assistant","content":"for v in vec {\n println!(\"{}\", v);\n}"}]} | |
| {"messages":[{"role":"user","content":"Show me how to merge two sets in Python."},{"role":"assistant","content":"set1.union(set2)"}]} | |
| {"messages":[{"role":"user","content":"I want a SQL query that finds all records with NULL values."},{"role":"assistant","content":"SELECT * FROM table_name WHERE column_name IS NULL;"}]} | |
| {"messages":[{"role":"user","content":"Show me how to get the last key in a Python dictionary."},{"role":"assistant","content":"list(my_dict.keys())[-1]"}]} | |
| {"messages":[{"role":"user","content":"I need a Java example for checking if a string starts with a prefix."},{"role":"assistant","content":"s.startsWith(\"abc\")"}]} | |
| {"messages":[{"role":"user","content":"Show me how to calculate exponentiation in Python using pow."},{"role":"assistant","content":"pow(a, b)"}]} | |
| {"messages":[{"role":"user","content":"I want a JavaScript example for converting a number to string."},{"role":"assistant","content":"String(n)"}]} | |
| {"messages":[{"role":"user","content":"Show me how to check if a Python list is empty using boolean context."},{"role":"assistant","content":"if not my_list:\n print(\"empty\")"}]} | |
| {"messages":[{"role":"user","content":"I need a C# example for removing an item from a list."},{"role":"assistant","content":"list.Remove(item);"}]} | |
| {"messages":[{"role":"user","content":"Show me how to calculate sum of squares in Python."},{"role":"assistant","content":"sum(x*x for x in my_list)"}]} | |
| {"messages":[{"role":"user","content":"I want a Go example for checking if a string contains substring."},{"role":"assistant","content":"strings.Contains(s, \"text\")"}]} | |
| {"messages":[{"role":"user","content":"Show me how to convert string to lowercase in Java."},{"role":"assistant","content":"s.toLowerCase();"}]} | |
| {"messages":[{"role":"user","content":"I need a Python example for finding unique elements in a list."},{"role":"assistant","content":"list(set(my_list))"}]} | |
| {"messages":[{"role":"user","content":"Show me how to calculate square root using JavaScript."},{"role":"assistant","content":"Math.sqrt(x)"}]} | |
| {"messages":[{"role":"user","content":"I want a Rust example for checking if a number is even."},{"role":"assistant","content":"n % 2 == 0"}]} | |
| {"messages":[{"role":"user","content":"Show me how to split a string by commas in Python."},{"role":"assistant","content":"s.split(\",\")"}]} | |
| {"messages":[{"role":"user","content":"I need a SQL example for updating multiple rows."},{"role":"assistant","content":"UPDATE table_name SET column_name = value WHERE condition;"}]} | |
| {"messages":[{"role":"user","content":"Show me how to convert float to int in Python."},{"role":"assistant","content":"int(x)"}]} | |
| {"messages":[{"role":"user","content":"I want a JavaScript example for checking NaN values."},{"role":"assistant","content":"isNaN(x)"}]} | |
| {"messages":[{"role":"user","content":"Show me how to iterate over keys in a Python dictionary."},{"role":"assistant","content":"for k in my_dict:\n print(k)"}]} | |
| {"messages":[{"role":"user","content":"I need a Go example for appending multiple values to a slice."},{"role":"assistant","content":"arr = append(arr, 1, 2, 3)"}]} | |
| {"messages":[{"role":"user","content":"Show me how to check if a string is lowercase in Python."},{"role":"assistant","content":"s.islower()"}]} | |
| {"messages":[{"role":"user","content":"I want a C++ example for checking if a number is odd."},{"role":"assistant","content":"if (n % 2 != 0) {\n cout << \"odd\";\n}"}]} | |
| {"messages":[{"role":"user","content":"Show me how to calculate 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":"I need a Python example for checking if a file is readable."},{"role":"assistant","content":"import os\nos.access(\"file.txt\", os.R_OK)"}]} | |
| {"messages":[{"role":"user","content":"Show me how to get the maximum key in a Python dictionary."},{"role":"assistant","content":"max(my_dict.keys())"}]} | |
| {"messages":[{"role":"user","content":"I want a Java example for converting string to integer safely."},{"role":"assistant","content":"Integer.parseInt(s);"}]} | |
| {"messages":[{"role":"user","content":"Show me how to check if a list has duplicates in JavaScript."},{"role":"assistant","content":"new Set(arr).size !== arr.length"}]} | |
| {"messages":[{"role":"user","content":"I need a Rust example for reversing a vector."},{"role":"assistant","content":"vec.reverse();"}]} | |
| {"messages":[{"role":"user","content":"Show me how to compute average using Python list comprehension."},{"role":"assistant","content":"sum(my_list) / len(my_list)"}]} | |
| {"messages":[{"role":"user","content":"I want a SQL query that finds the minimum salary."},{"role":"assistant","content":"SELECT MIN(salary) FROM employees;"}]} | |
| {"messages":[{"role":"user","content":"Show me how to convert a string to list of words in JavaScript."},{"role":"assistant","content":"s.split(\" \")"}]} | |
| {"messages":[{"role":"user","content":"I need a Python snippet to check whether a number is a perfect square."},{"role":"assistant","content":"int(n**0.5)**2 == n"}]} | |
| {"messages":[{"role":"user","content":"Show me how to convert a list of strings into a single comma-separated string in Python."},{"role":"assistant","content":", ".join(my_list)"}]} | |
| {"messages":[{"role":"user","content":"I want a JavaScript example to check if an array includes a value safely."},{"role":"assistant","content":"Array.isArray(arr) && arr.includes(value)"}]} | |
| {"messages":[{"role":"user","content":"Show me how to get the last item of a Python set converted to a list."},{"role":"assistant","content":"list(my_set)[-1]"}]} | |
| {"messages":[{"role":"user","content":"I need a Go example for checking if a number is even or odd."},{"role":"assistant","content":"if n%2 == 0 {\n fmt.Println(\"even\")\n} else {\n fmt.Println(\"odd\")\n}"}]} | |
| {"messages":[{"role":"user","content":"Show me how to convert Celsius to Kelvin in Python."},{"role":"assistant","content":"c + 273.15"}]} | |
| {"messages":[{"role":"user","content":"I want a Rust example for converting string to integer safely using Result."},{"role":"assistant","content":"let num: Result<i32, _> = s.parse();"}]} | |
| {"messages":[{"role":"user","content":"Show me how to find the second smallest number in a Python list."},{"role":"assistant","content":"sorted(set(my_list))[1]"}]} | |
| {"messages":[{"role":"user","content":"I need a SQL query that deletes rows older than a specific date."},{"role":"assistant","content":"DELETE FROM table_name WHERE created_at < '2024-01-01';"}]} | |
| {"messages":[{"role":"user","content":"Show me how to check if a string contains only digits in Python."},{"role":"assistant","content":"s.isdigit()"}]} | |
| {"messages":[{"role":"user","content":"I want a Java example for converting a list to an array."},{"role":"assistant","content":"list.toArray(new String[0]);"}]} | |
| {"messages":[{"role":"user","content":"Show me how to calculate factorial using math library in C++."},{"role":"assistant","content":"// no built-in factorial, use loop or recursion"}]} | |
| {"messages":[{"role":"user","content":"I need a Python example for flattening a 2D list using itertools."},{"role":"assistant","content":"import itertools\nlist(itertools.chain.from_iterable(my_list))"}]} | |
| {"messages":[{"role":"user","content":"Show me how to check if a JavaScript string is empty after trimming."},{"role":"assistant","content":"s.trim().length === 0"}]} | |
| {"messages":[{"role":"user","content":"I want a Go example for checking if a map contains a key safely."},{"role":"assistant","content":"_, ok := m[key]"}]} | |
| {"messages":[{"role":"user","content":"Show me how to convert integer to binary string in Python."},{"role":"assistant","content":"bin(n)"}]} | |
| {"messages":[{"role":"user","content":"I need a Rust example for checking vector length equality."},{"role":"assistant","content":"vec1.len() == vec2.len()"}]} | |
| {"messages":[{"role":"user","content":"Show me how to remove a key from a Python dictionary safely."},{"role":"assistant","content":"my_dict.pop(key, None)"}]} | |
| {"messages":[{"role":"user","content":"I want a SQL query that counts rows grouped by status."},{"role":"assistant","content":"SELECT status, COUNT(*) FROM table_name GROUP BY status;"}]} | |
| {"messages":[{"role":"user","content":"Show me how to check if a number is divisible by both 2 and 3 in Python."},{"role":"assistant","content":"n % 2 == 0 and n % 3 == 0"}]} | |
| {"messages":[{"role":"user","content":"I need a JavaScript example for finding unique values in an array."},{"role":"assistant","content":"[...new Set(arr)]"}]} | |
| {"messages":[{"role":"user","content":"Show me how to compute power using recursion in Python."},{"role":"assistant","content":"def power(a, b):\n if b == 0:\n return 1\n return a * power(a, b-1)"}]} | |
| {"messages":[{"role":"user","content":"I want a Go example for slicing an array safely."},{"role":"assistant","content":"arr[1:3]"}]} | |
| {"messages":[{"role":"user","content":"Show me how to check if a string starts and ends with same character in Python."},{"role":"assistant","content":"s[0] == s[-1]"}]} | |
| {"messages":[{"role":"user","content":"I need a C# example for converting string to double."},{"role":"assistant","content":"double.Parse(s);"}]} | |
| {"messages":[{"role":"user","content":"Show me how to generate random boolean in JavaScript."},{"role":"assistant","content":"Math.random() > 0.5"}]} | |
| {"messages":[{"role":"user","content":"I want a Python example for checking if all values in a dictionary are positive."},{"role":"assistant","content":"all(v > 0 for v in my_dict.values())"}]} | |
| {"messages":[{"role":"user","content":"Show me how to merge sorted lists in Python."},{"role":"assistant","content":"sorted(list1 + list2)"}]} | |
| {"messages":[{"role":"user","content":"I need a Rust example for iterating over string characters."},{"role":"assistant","content":"for c in s.chars() {\n println!(\"{}\", c);\n}"}]} | |
| {"messages":[{"role":"user","content":"Show me how to convert list to tuple in Python."},{"role":"assistant","content":"tuple(my_list)"}]} | |
| {"messages":[{"role":"user","content":"I want a SQL query that selects top 3 highest salaries."},{"role":"assistant","content":"SELECT DISTINCT salary FROM employees ORDER BY salary DESC LIMIT 3;"}]} | |
| {"messages":[{"role":"user","content":"Show me how to check if a JavaScript object is empty."},{"role":"assistant","content":"Object.keys(obj).length === 0"}]} | |
| {"messages":[{"role":"user","content":"I need a Go example for converting integer to string using formatting."},{"role":"assistant","content":"fmt.Sprintf(\"%d\", n)"}]} | |
| {"messages":[{"role":"user","content":"Show me how to reverse words in JavaScript string."},{"role":"assistant","content":"s.split(\" \").reverse().join(\" \")"}]} | |
| {"messages":[{"role":"user","content":"I want a Python example for checking if a string is palindrome ignoring spaces."},{"role":"assistant","content":"s.replace(' ', '') == s.replace(' ', '')[::-1]"}]} | |
| {"messages":[{"role":"user","content":"Show me how to calculate square root manually in Python using exponentiation."},{"role":"assistant","content":"n ** 0.5"}]} | |
| {"messages":[{"role":"user","content":"I need a Java example for checking if a list contains duplicates."},{"role":"assistant","content":"new HashSet<>(list).size() != list.size()"}]} | |
| {"messages":[{"role":"user","content":"Show me how to filter even numbers in JavaScript array."},{"role":"assistant","content":"arr.filter(x => x % 2 === 0)"}]} | |
| {"messages":[{"role":"user","content":"I want a Rust example for checking if Option is None."},{"role":"assistant","content":"option.is_none()"}]} | |
| {"messages":[{"role":"user","content":"Show me how to convert string to float in Python safely."},{"role":"assistant","content":"float(s)"}]} | |
| {"messages":[{"role":"user","content":"I need a C++ example for checking if a vector contains a value."},{"role":"assistant","content":"find(v.begin(), v.end(), value) != v.end()"}]} | |
| {"messages":[{"role":"user","content":"Show me how to calculate sum using Python while loop."},{"role":"assistant","content":"total = 0\nwhile n > 0:\n total += n\n n -= 1"}]} | |
| {"messages":[{"role":"user","content":"I want a SQL example for updating a column conditionally."},{"role":"assistant","content":"UPDATE table_name SET column = value WHERE condition;"}]} | |
| {"messages":[{"role":"user","content":"Show me how to check if a JavaScript number is integer."},{"role":"assistant","content":"Number.isInteger(n)"}]} | |
| {"messages":[{"role":"user","content":"I need a Python example for finding max difference in list."},{"role":"assistant","content":"max(my_list) - min(my_list)"}]} | |
| {"messages":[{"role":"user","content":"Show me how to join two strings in Go."},{"role":"assistant","content":"s1 + s2"}]} | |
| {"messages":[{"role":"user","content":"I want a Rust example for checking if vector contains duplicates."},{"role":"assistant","content":"let mut v2 = v.clone(); v2.sort(); v2.windows(2).any(|w| w[0] == w[1])"}]} | |
| {"messages":[{"role":"user","content":"Show me how to convert list to dictionary in Python using index."},{"role":"assistant","content":"{i: v for i, v in enumerate(my_list)}"}]} | |
| {"messages":[{"role":"user","content":"I need a Java example for sorting an array in descending order."},{"role":"assistant","content":"Arrays.sort(arr, Collections.reverseOrder());"}]} |