Questions tagged [collections]

Collections APIs provide developers with a set of classes and interfaces that makes it easier to handle collections of objects.

18 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4 votes
0 answers
90 views

C++14 AtomicRoundRobinPool for sharing a pool of keys

The idea here is that we have some resource that is relatively very expensive to generate, but once we have a bunch of them in a pool, we can keep reusing them instead of generating new ones. "HTTP ...
Quuxplusone's user avatar
  • 19.3k
4 votes
0 answers
143 views

Generic Macro Generated Interval Heap in C

When I saw this amazing data structure I couldn't stop myself from trying it! I first sought resources such as this and an article about it here. It basically works as a Max-Heap and a Min-Heap at the ...
LeoVen's user avatar
  • 337
4 votes
0 answers
125 views

C++11 Removable connection from emitter or receiver object

Please review my solution for the following problem. I am interested in: Maintainability Usability Logical correctness Efficiency Problem: It has 1+ objects each in separated thread and between the ...
István Simon's user avatar
3 votes
0 answers
223 views

Implementation of Dynamic Array with allocators and C++20

To train my skills in C++, I decided to implement the well-known "Dynamic array" data structure on my own. I realized early on that using pointers or smart pointers is wrong, as it leads to ...
PavelDev's user avatar
  • 131
3 votes
0 answers
168 views

Simple generic macro-generated containers

In order to learn macros in C I decided to make a generic data structures generator for other projects that I have in C. The main macros are the following: ...
LeoVen's user avatar
  • 337
3 votes
0 answers
126 views

Allowing switching between operator[] and at() based on NDEBUG macro version

The problem: std::vector and other containers have two functions for accessing / modifying their content: operator[] and ...
gaazkam's user avatar
  • 561
3 votes
0 answers
76 views

A matrix class for objects other than numbers

I'm in the process of writing a matrix like container to store objects. Despite many existing matrix implementations, I won't do numerics. Instead I want to replace a ...
dani's user avatar
  • 147
3 votes
0 answers
173 views

Deque class using typing module

I wanted to make a class for type hinting that the result of a function is a homogenous deque. ...
Broseph's user avatar
  • 131
2 votes
0 answers
95 views

Game involving finding words containing letters from a memorized list

I wrote this Java game where the user memorizes a list, gets given letters and needs to find a word that contains those letters. The player has only a few seconds to enter the word. Example: Program ...
Paul Lemarchand's user avatar
2 votes
0 answers
66 views

Iterating in a list of data and search data in another datatable

I have a list which has 25000 data and I am iterating in all data and in each iteration, I am searching data in another data table. my whole routine is taking a long time to finish. Loading data from ...
user197025's user avatar
2 votes
0 answers
30 views

How to connect a propery class/object with a collection (its database class)?

I'm struggling with organizing my code regarding 'best practise'. In particular how I link a class with its collection class. I've 2 classes: ...
Xavin's user avatar
  • 121
2 votes
0 answers
569 views

Flattening a map into a list of records

In my everyday work I'm trying to move away from traditional iterating over collections to a more Java 8 streams-like behavior. I'm currently working on a project where I have a collection defined as: ...
Jiinxy's user avatar
  • 129
2 votes
0 answers
107 views

Set manipulation (javascript arrays) using lodash

I'd like a more elegant and readable (if possible using functional programming style) for collection filtering (groupToAdd and groupToDelete collection handling) Just getting rid of multiple _....
Gab's user avatar
  • 121
2 votes
0 answers
282 views

Better way to deep copy than this? How can I make it generic by `Collection` type?

Could I make this method for deep copy generic to the Collection type? That method is so simple and I can't imagine ever needing to change it, so maybe I should ...
david.t's user avatar
  • 215
1 vote
0 answers
999 views

Spring Boot Integration Test with SQS and Elastic Search

I have the following integration test that starts with sending message to sqs queue and ends with checking elastic search if the associated object added to db. The part of application I want to test ...
Davis's user avatar
  • 53
1 vote
0 answers
91 views

Further dive into filtering using IPredicate

Preface This is a follow up to my previous post from not long time ago about containers and filtering. This post can be found here. Now, I will attempt to expand what I have learnt from the answer ...
FlameHorizon's user avatar
1 vote
0 answers
2k views

Custom dictionary class for reading and writing json value to a file

Is my implementation good? The program works as planned, but I wonder if some parts of the code can be made cleaner or more efficient. The file output looks like this: ...
KamRon's user avatar
  • 11
0 votes
0 answers
74 views

Grouping and summing by condition from three mongodb collections

I have three mongodb collections. I would like to group the collections by date, month and year, then sum by condition in order to display totals from the three collections in one table. However, i ...
user20183888's user avatar