Questions tagged [collections]

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

23 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
13
votes
0answers
197 views

Multi-function memoizator and multi-type container

I'm trying to write a multiple functions memoizator, which I've talked about here. The main problem is creating a container containing different and heterogenous functions. I found a working solution,...
4
votes
0answers
60 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 ...
4
votes
0answers
96 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 ...
4
votes
0answers
117 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 ...
3
votes
0answers
39 views

Dependency Container

I'm currently creating my own microframework for learning purpose and I want to make it more powerful by providing a way to register classes and instantiate them (once) only when needed. So here is my ...
3
votes
0answers
100 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 ...
3
votes
0answers
75 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 ...
3
votes
0answers
144 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. ...
2
votes
0answers
78 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 ...
2
votes
0answers
62 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 ...
2
votes
0answers
92 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: ...
2
votes
0answers
19 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: ...
2
votes
0answers
538 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: ...
2
votes
0answers
97 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 _....
2
votes
0answers
274 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 ...
1
vote
0answers
74 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 ...
1
vote
0answers
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: ...
1
vote
0answers
96 views

Purely functional octree and octree priority queue

I'm programming a game in Scala, and a lot of tasks are able to be done in the background. I've created a system in which each Future can be assigned a position in 3d space, and they are stored in an ...
1
vote
0answers
86 views

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

The problem: std::vector and other containers have two functions for accessing / modifying their content: operator[] and ...
1
vote
0answers
62 views

Merging results of product searches by category, price, and manufacturer

Following is code which takes three arguments as String Map String now I already have some predefined methods which return the requirement of both String as List ...
1
vote
0answers
246 views

.NET List Serializer design

A few weeks back I wrote a class to help serialize/deserialize objects file. The file format requested was json, then compressed. After some coding/testing I settled on this design: ...
1
vote
0answers
48 views

Custom expression that filters elements based on jQuery internal data

With jQuery, I'd like to be able to easily select the following types of elements: Elements that have a specific value set for a specific data attribute in the raw HTML Elements that have had a ...
1
vote
0answers
60 views

NonEmptySortedSet implementation

I'm looking for feedback specifically about what I might add to this to make it more usable or general, especially with regard to scala collection traits to implement. ...