wafee-ops commited on
Commit
e751bd6
·
verified ·
1 Parent(s): 7086840

Update data.jsonl

Browse files
Files changed (1) hide show
  1. data.jsonl +97 -1
data.jsonl CHANGED
@@ -198,4 +198,100 @@
198
 
199
  {"messages":[{"role":"user","content":"I want a JavaScript example for finding array length."},{"role":"assistant","content":"arr.length"}]}
200
 
201
- {"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"}]}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
198
 
199
  {"messages":[{"role":"user","content":"I want a JavaScript example for finding array length."},{"role":"assistant","content":"arr.length"}]}
200
 
201
+ {"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"}]}
202
+
203
+ {"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))"}]}
204
+
205
+ {"messages":[{"role":"user","content":"Show me how to convert a string into a list of characters in Python."},{"role":"assistant","content":"list(s)"}]}
206
+
207
+ {"messages":[{"role":"user","content":"I need a JavaScript example for checking if a number is finite."},{"role":"assistant","content":"Number.isFinite(n)"}]}
208
+
209
+ {"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))"}]}
210
+
211
+ {"messages":[{"role":"user","content":"I want a Go example for converting a float to an integer."},{"role":"assistant","content":"int(f)"}]}
212
+
213
+ {"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]"}]}
214
+
215
+ {"messages":[{"role":"user","content":"I need a Rust example for checking if a number is positive."},{"role":"assistant","content":"n > 0"}]}
216
+
217
+ {"messages":[{"role":"user","content":"Show me how to find the first element in a Python dictionary."},{"role":"assistant","content":"next(iter(my_dict))"}]}
218
+
219
+ {"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;"}]}
220
+
221
+ {"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)"}]}
222
+
223
+ {"messages":[{"role":"user","content":"I need a Java example for reversing an integer array."},{"role":"assistant","content":"Collections.reverse(Arrays.asList(arr));"}]}
224
+
225
+ {"messages":[{"role":"user","content":"Show me how to check if a string is numeric in JavaScript."},{"role":"assistant","content":"!isNaN(s)"}]}
226
+
227
+ {"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')"}]}
228
+
229
+ {"messages":[{"role":"user","content":"Show me how to find the maximum value in a dictionary in Python."},{"role":"assistant","content":"max(my_dict.values())"}]}
230
+
231
+ {"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}"}]}
232
+
233
+ {"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)"}]}
234
+
235
+ {"messages":[{"role":"user","content":"I want a Go example for converting int to string safely."},{"role":"assistant","content":"strconv.Itoa(n)"}]}
236
+
237
+ {"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"}]}
238
+
239
+ {"messages":[{"role":"user","content":"I need a JavaScript example for rounding down a number."},{"role":"assistant","content":"Math.floor(x)"}]}
240
+
241
+ {"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)"}]}
242
+
243
+ {"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\")"}]}
244
+
245
+ {"messages":[{"role":"user","content":"Show me how to split a string into words in Java."},{"role":"assistant","content":"s.split(\" \");"}]}
246
+
247
+ {"messages":[{"role":"user","content":"I need a Python example for merging multiple dictionaries."},{"role":"assistant","content":"{**a, **b, **c}"}]}
248
+
249
+ {"messages":[{"role":"user","content":"Show me how to calculate absolute difference in JavaScript."},{"role":"assistant","content":"Math.abs(a - b)"}]}
250
+
251
+ {"messages":[{"role":"user","content":"I want a Go example for checking nil maps."},{"role":"assistant","content":"if m == nil {\n // handle\n}"}]}
252
+
253
+ {"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))"}]}
254
+
255
+ {"messages":[{"role":"user","content":"I need a C# example for checking if a string contains a substring."},{"role":"assistant","content":"s.Contains(\"text\")"}]}
256
+
257
+ {"messages":[{"role":"user","content":"Show me how to calculate the square of a number in Python."},{"role":"assistant","content":"x * x"}]}
258
+
259
+ {"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;"}]}
260
+
261
+ {"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"}]}
262
+
263
+ {"messages":[{"role":"user","content":"I need a Java example for checking array equality."},{"role":"assistant","content":"Arrays.equals(arr1, arr2);"}]}
264
+
265
+ {"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)]"}]}
266
+
267
+ {"messages":[{"role":"user","content":"I want a Rust example for converting float to string."},{"role":"assistant","content":"format!(\"{}\", f)"}]}
268
+
269
+ {"messages":[{"role":"user","content":"Show me how to find the minimum value in a JavaScript array."},{"role":"assistant","content":"Math.min(...arr)"}]}
270
+
271
+ {"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)"}]}
272
+
273
+ {"messages":[{"role":"user","content":"Show me how to remove the first element from a Python list."},{"role":"assistant","content":"my_list.pop(0)"}]}
274
+
275
+ {"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}"}]}
276
+
277
+ {"messages":[{"role":"user","content":"Show me how to convert string to int in JavaScript."},{"role":"assistant","content":"parseInt(s)"}]}
278
+
279
+ {"messages":[{"role":"user","content":"I need a Python example for checking if a string ends with a suffix."},{"role":"assistant","content":"s.endswith(\"abc\")"}]}
280
+
281
+ {"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"}]}
282
+
283
+ {"messages":[{"role":"user","content":"I want a C++ example for finding maximum element in an array."},{"role":"assistant","content":"*max_element(arr, arr + n);"}]}
284
+
285
+ {"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)"}]}
286
+
287
+ {"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}"}]}
288
+
289
+ {"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"}]}
290
+
291
+ {"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])"}]}
292
+
293
+ {"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)"}]}
294
+
295
+ {"messages":[{"role":"user","content":"I need a JavaScript example for checking if a string is empty or whitespace."},{"role":"assistant","content":"!s.trim()"}]}
296
+
297
+ {"messages":[{"role":"user","content":"Show me how to compute factorial using Python math library."},{"role":"assistant","content":"import math\nmath.factorial(n)"}]}