Skip to main content
Filter by
Sorted by
Tagged with
-3 votes
1 answer
109 views

Why do we return self in the iter method when we define the next method in the iterable and iterator classes? This topic was taught in the course, but it was hard to understand and I didn't understand ...
Samyar's user avatar
  • 1
3 votes
1 answer
98 views

I have a simple SequencesRange class that can iterate random genomic sequences of fixed size. When I try to join the characters of all sequences with std::views::join, it works well, but as soon I try ...
abcdefg's user avatar
  • 4,442
0 votes
1 answer
49 views

I'm trying to understand what's inside an iterator object. Q: How can I see every property/method of an object, in this case an iteration object? How can I see exactly of what an object is made of? ...
Harry Fish's user avatar
0 votes
1 answer
213 views

I want to use Iterator.prototype.take() in my code but TypeScript keeps complaining it doesn't exist even though in runtime everything works as expected. Property 'take' does not exist on type '...
ansavchenco's user avatar
0 votes
0 answers
50 views

This is the javascript function I'm unsuccessfully trying to make vscode show autocomplete suggestions for the returned object: const profile = (form, validation) => Object.defineProperties( {...
Alexandr Kalabin's user avatar
3 votes
7 answers
213 views

Let's say I have a number of iterables: [[1, 2], [3, 4, 5, 6], [7, 8, 9], [10, 11, 12, 13, 14]] How can I get only each element that is the first to appear at its index in any of the iterables? In ...
qulinxao's user avatar
  • 332
0 votes
0 answers
118 views

I am a student. You might think I'm overloading the code with this, unnecessarily, but the goal is just to improve the understanding of the collect method. So all these components that I mention are ...
Saerujeji Reebu CHINA's user avatar
-1 votes
1 answer
151 views

I have C++ code written around March 2023. It compiled fine back then. Now, I have to make a few changes to it, but it doesn't compile anymore. The used language standard was C++20. I don't remember ...
Alex's user avatar
  • 819
0 votes
0 answers
58 views

I am trying to evaluate an ARIMA model. To evaluate the model, I want to use 5 days into the future as test data. forecast_data = model_fit.forecast(steps=5) # Last 5 days of forecast data ...
Bon's user avatar
  • 21
0 votes
1 answer
75 views

The following is the code cross section from gunicorn.workers.sync.SyncWorker class self.handle method: def handle(self, listener, client, addr): req = None try: if self....
Humbulani's user avatar
2 votes
1 answer
160 views

iterator is the generic word for something that can iterate a collection of objects. On the other hand, I'm not sure that there is a commonly accepted word in C++ for the collection itself, in ...
abcdefg's user avatar
  • 4,442
1 vote
0 answers
1k views

I'm trying to make 2 instances of a Swiper slider, so I can have 2 kinds of sliders on the same page. A video and a review slider. I'm encountering a warning that says "jQuery.Deferred exception: ...
claudiatjuhhh's user avatar
0 votes
1 answer
52 views

I'm wondering if CODE 2 requires 41880+ of memory space anyways, since I "created" a list... but perhaps not because I didn't store it in a variable? In other words, are CODE 1 and CODE 2 ...
dungarian's user avatar
  • 233
-1 votes
1 answer
62 views

Given 2 iterables/lists, the goal is to extract the common and different elements from both lists. For example, given: x, y = [1,1,5,2,2,3,4,5,5], [2,3,4,5] The goal is to achieve: common = [2,3,4,5] ...
alvas's user avatar
  • 123k
1 vote
1 answer
94 views

I have a Python application which has two nested with blocks, one of which occurs inside an object's __iter__ method. I have observed that wrapping the iterable object inside a generator expression ...
Adam Tuft's user avatar
1 vote
1 answer
100 views

I'm having some problems with the plot of some iterable classes in Python. The idea is to use plotly to plot lines obtained from the iterator of a class. Here is an example of the class: class ...
José  Fuentes's user avatar
-1 votes
1 answer
36 views

a = [['a', 20], ['b', 36], ['c', 1], ['d', 8], ['e', 55]] How can I print out the minimum value or maximum value by using Python built-in functions like min() or max()? The result would look like ['e'...
Zaman's user avatar
  • 21
-2 votes
1 answer
168 views

TypeError Traceback (most recent call last) <ipython-input-10-6eada5f638a8> in <cell line: 8>() 15 result = oddNumbers(l, r) 16 ---> 17 ...
Gaddipalli Vennela's user avatar
2 votes
1 answer
1k views

How can I differentiate between iterables that become empty after iteration and those that don't, in TypeScript? type ReusableIterable<T> = Iterable<T> // ? function iterate(iterable: ...
Gnlow's user avatar
  • 33
-2 votes
1 answer
394 views

So I made a function which i later imported to another file no i am trying to make a web application using stream lit where I want user to upload a data and that data should go through my function and ...
Avneesh Jagwani's user avatar
-1 votes
1 answer
101 views

This is my code snippet from itertools import zip_longest list1 = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'] args = [iter(list1)] * 4 zipped = zip_longest(*args, fillvalue=None) for j in ...
kamote0330's user avatar
0 votes
4 answers
547 views

Suppose I have the following lists: list_1 = [[1,2],[3,4],[5,6],[7,8]] list_2 = [11,12,13,14] How can I add items from the second list to each of the items from the first one? Stated clearly, this is ...
Felipe D.'s user avatar
  • 1,291
0 votes
3 answers
544 views

It's telling me "TypeError: Foo.my_method(...) is not a function or its return value is not async iterable". How to make it so? class Foo { constructor() { return (async () => { ...
rigiva's user avatar
  • 11
1 vote
1 answer
1k views

Whats an efficient way to convert iterable to list of entity? in below code. last line which collects to list - take ~70seconds for large data set (about 400k) //mongoDB: reading from collection ...
DevToCode's user avatar
2 votes
3 answers
240 views

Some methods in Javascript, for example Map.prototype.values, return an iterable. Without writing a function to iterate through the values, can I map them to something else as per Array.prototype.map?...
intuited's user avatar
  • 24.2k

1
2 3 4 5
27