Questions tagged [collections]

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

1
vote
1answer
729 views

Set, List and Map equality comparison with Lambda check

I'd like to be able to compare two objects with different equality checks. This should work if they're in a Set, List or ...
10
votes
0answers
170 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,...
8
votes
0answers
109 views

Binary Search Tree Implementation in C++17

I am a hobbyist computer programmer trying to learn modern C++ (in this case C++17). I thought it might be an interesting challenge to write a Binary Search Tree similar to ...
4
votes
0answers
116 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
37 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
73 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
72 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
129 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
57 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
47 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
447 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
94 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
238 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

Data structure that is fast to read and modify

I'm working on an apllication that needs to process a lot of objects in realtime. I've separated the logic from the UI so that it isn't as much of a mess. The basic idea is that every tick I'm trying ...
1
vote
0answers
64 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
1k 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
80 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
73 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
61 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
230 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
181 views

Splitting two ObservableCollections lightning fast

I'm working on wiring up a bindable Map for Xamarin Forms, and I need a fast way of dividing up the ObservableCollections (collection of map markers) as quickly as possible. Collections are a weak ...
1
vote
0answers
47 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. ...
0
votes
0answers
20 views

Extension to BindingList<T> that allows for cancelable notifications of changing and deleting

This is an extension of the System.ComponentModel.BindingList<T> class that allows for notifications of item changing and deleting. These notifications ...