wafee-ops commited on
Commit
33fc829
·
verified ·
1 Parent(s): abcc2aa

Update data.jsonl

Browse files
Files changed (1) hide show
  1. data.jsonl +39 -1
data.jsonl CHANGED
@@ -794,4 +794,42 @@
794
 
795
  {"messages":[{"role":"user","content":"JS set creation example"},{"role":"assistant","content":"JavaScript Set objects automatically enforce uniqueness.\n\n```javascript\nconst set = new Set([1,2,3]);\n```\n\nThis removes duplicate values."}]}
796
 
797
- {"messages":[{"role":"user","content":"SQL limit rows example"},{"role":"assistant","content":"LIMIT restricts the number of rows returned by a query.\n\n```sql\nSELECT * FROM users LIMIT 10;\n```\n\nThis fetches only the first 10 rows."}]}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
794
 
795
  {"messages":[{"role":"user","content":"JS set creation example"},{"role":"assistant","content":"JavaScript Set objects automatically enforce uniqueness.\n\n```javascript\nconst set = new Set([1,2,3]);\n```\n\nThis removes duplicate values."}]}
796
 
797
+ {"messages":[{"role":"user","content":"SQL limit rows example"},{"role":"assistant","content":"LIMIT restricts the number of rows returned by a query.\n\n```sql\nSELECT * FROM users LIMIT 10;\n```\n\nThis fetches only the first 10 rows."}]}
798
+
799
+ {"messages":[{"role":"user","content":"I want to check if a Python set contains a specific element."},{"role":"assistant","content":"In Python, membership checks in sets are extremely fast because sets use hash tables internally. You can simply use the 'in' keyword.\n\n```python\nelement in my_set\n```\nThis returns True if the element exists in the set, otherwise False."}]}
800
+
801
+ {"messages":[{"role":"user","content":"Create an empty list in Python for storing future values."},{"role":"assistant","content":"When you need a dynamic container in Python that can grow over time, an empty list is the simplest starting point.\n\n```python\nmy_list = []\n```\nYou can later append or extend it as needed."}]}
802
+
803
+ {"messages":[{"role":"user","content":"Add an item to a JavaScript array efficiently."},{"role":"assistant","content":"JavaScript arrays have built-in methods for dynamic insertion. The most common is 'push'.\n\n```javascript\narr.push(item);\n```\nThis appends the element to the end of the array."}]}
804
+
805
+ {"messages":[{"role":"user","content":"Find the minimum value inside a JavaScript array."},{"role":"assistant","content":"To compute the smallest number in an array, JavaScript allows you to spread values into Math.min.\n\n```javascript\nMath.min(...arr)\n```\nThis returns the lowest numeric value in the array."}]}
806
+
807
+ {"messages":[{"role":"user","content":"Check if a number is greater than zero in Python."},{"role":"assistant","content":"A simple comparison operator can be used to test positivity.\n\n```python\nn > 0\n```\nThis expression evaluates to True when the number is positive."}]}
808
+
809
+ {"messages":[{"role":"user","content":"Convert an integer into a string in Python."},{"role":"assistant","content":"Python provides a built-in conversion function for turning numbers into text.\n\n```python\nstr(n)\n```\nThis is useful when concatenating numbers with strings or formatting output."}]}
810
+
811
+ {"messages":[{"role":"user","content":"Print a variable to the console in Rust."},{"role":"assistant","content":"Rust uses macros for formatted output. The println! macro is the standard way to display values.\n\n```rust\nprintln!(\"{}\", value);\n```\nThis prints the variable using string formatting."}]}
812
+
813
+ {"messages":[{"role":"user","content":"Remove an element from a Python set safely."},{"role":"assistant","content":"Sets in Python allow removal of elements using the remove method, but it will error if the element doesn't exist.\n\n```python\nmy_set.remove(value)\n```\nUse discard() instead if you want to avoid errors when missing."}]}
814
+
815
+ {"messages":[{"role":"user","content":"Select only non-null rows in a SQL table."},{"role":"assistant","content":"SQL provides IS NOT NULL to filter out missing values in a column.\n\n```sql\nSELECT * FROM table_name WHERE column_name IS NOT NULL;\n```\nThis ensures only valid entries are returned."}]}
816
+
817
+ {"messages":[{"role":"user","content":"Find the size of a Python dictionary."},{"role":"assistant","content":"The built-in len() function returns the number of key-value pairs in a dictionary.\n\n```python\nlen(my_dict)\n```\nThis gives the total number of entries stored."}]}
818
+
819
+ {"messages":[{"role":"user","content":"Create an empty slice in Go."},{"role":"assistant","content":"In Go, slices are dynamic views over arrays. You can declare an empty one like this:\n\n```go\nvar arr []int\n```\nIt can later be appended to as needed."}]}
820
+
821
+ {"messages":[{"role":"user","content":"Check if a string contains a substring in Python."},{"role":"assistant","content":"Python supports direct substring checks using the 'in' operator.\n\n```python\nsubstring in s\n```\nThis returns True if the substring is found anywhere inside the string."}]}
822
+
823
+ {"messages":[{"role":"user","content":"Convert a string to uppercase in Java."},{"role":"assistant","content":"Java strings have built-in methods for case conversion.\n\n```java\ns.toUpperCase();\n```\nThis returns a new string with all characters in uppercase."}]}
824
+
825
+ {"messages":[{"role":"user","content":"Compute square root of a number in Python."},{"role":"assistant","content":"Python's math module provides a precise square root function.\n\n```python\nimport math\nmath.sqrt(x)\n```\nThis returns the non-negative square root of x."}]}
826
+
827
+ {"messages":[{"role":"user","content":"Create a simple function that squares a number in JavaScript."},{"role":"assistant","content":"JavaScript allows concise arrow functions for small computations.\n\n```javascript\nconst square = x => x * x;\n```\nThis function returns the square of the input value."}]}
828
+
829
+ {"messages":[{"role":"user","content":"Loop through a Python dictionary and print its contents."},{"role":"assistant","content":"You can iterate over key-value pairs using the items() method.\n\n```python\nfor k, v in my_dict.items():\n print(k, v)\n```\nThis prints each key and its corresponding value."}]}
830
+
831
+ {"messages":[{"role":"user","content":"Check if a number is positive in C++."},{"role":"assistant","content":"C++ uses standard comparison operators inside conditional statements.\n\n```cpp\nif (n > 0) {\n cout << \"positive\";\n}\n```\nThis prints a message if the number is greater than zero."}]}
832
+
833
+ {"messages":[{"role":"user","content":"Convert a string to lowercase in JavaScript."},{"role":"assistant","content":"JavaScript provides a built-in method for lowercase conversion.\n\n```javascript\nstr.toLowerCase()\n```\nThis returns a new string in lowercase form."}]}
834
+
835
+ {"messages":[{"role":"user","content":"Check if a Python list is empty."},{"role":"assistant","content":"Python lists evaluate to False when empty, making checks very clean.\n\n```python\nlen(my_list) == 0\n```\nThis returns True when the list contains no elements."}]}