Questions tagged [containers]

A container is a class, a data structure, or an abstract data type whose instances are collections of other objects. Containers typically make use of generics or templates so that a wide variety of objects can be added.

Containers are available in most programming languages, allowing programmers to store, transfer, and read back data within a program. Common containers include arrays, lists, queues, stacks, sets, and maps, each providing different levels of efficiency for tasks such as adding or removing elements, searching for elements, or iterating through elements.

11206 questions
103
votes
9 answers

c++ deque vs queue vs stack

Queue and Stack are a structures widely mentioned. However, in C++, for queue you can do it in two ways: #include #include but for stack you can only do it like this #include My question is, what's the difference between…
skydoor
  • 25,218
  • 52
  • 147
  • 201
98
votes
13 answers

Copy map values to vector in STL

Working my way through Effective STL at the moment. Item 5 suggests that it's usually preferable to use range member functions to their single element counterparts. I currently wish to copy all the values in a map (i.e. - I don't need the keys) to a…
Gilad Naor
  • 20,752
  • 14
  • 46
  • 53
97
votes
9 answers

docker compose orphan containers warning

How to be with orphan images when you have 2 independent projects and you want them to work at the same time or at least to build running docker-compose up -d without --remove-orphans flag when images are already built for another project. docker…
Bogdan Dubyk
  • 4,756
  • 7
  • 30
  • 67
97
votes
7 answers

How do you delete an AWS ECS Task Definition?

Once you've created a task definition in Amazon's EC2 Container Service, how do you delete or remove it?
wjimenez5271
  • 2,027
  • 2
  • 17
  • 24
93
votes
7 answers

Push docker image to amazon ecs repository

Im new to AWS. I want to set up a private docker repository on an AWS ECS container instance. I created a repository named name. The example push commands shown by AWS are working. aws ecr get-login --region us-west-2 docker build -t name . docker…
Ohmen
  • 6,194
  • 3
  • 25
  • 35
91
votes
11 answers

Docker in Docker cannot mount volume

I am running a Jenkins cluster where in the Master and Slave, both are running as a Docker containers. The Host is latest boot2docker VM running on MacOS. To allow Jenkins to be able to perform deployment using Docker, I have mounted the…
ZephyrPLUSPLUS
  • 2,550
  • 2
  • 18
  • 13
90
votes
8 answers

How can I use std::maps with user-defined types as key?

I'm wondering why I can't use STL maps with user-defined classes. When I compile the code below, I get the following cryptic error message. What does it mean? Also, why is it only happening with user-defined types? (Primitive types are okay when…
unknown
  • 1,313
  • 3
  • 12
  • 7
87
votes
7 answers

How to change the size of the font of a JLabel to take the maximum size

I have a JLabel in a Container. The defaut size of the font is very small. I would like that the text of the JLabel to take the maximum size. How can I do that?
g123k
  • 3,748
  • 6
  • 42
  • 45
86
votes
3 answers

How to configure a Kubernetes Multi-Pod Deployment

I would like to deploy an application cluster by managing my deployment via k8s Deployment object. The documentation has me extremely confused. My basic layout has the following components that scale independently: API server UI server Redis…
80
votes
7 answers

wrapping Scaffold with Container for gradient background, How to set gradient to container background in flutter?

I'd like to wrap a Scaffold with a Container in order to get a gradient background that's also underneath the AppBar. Basically a full screen gradient background. However, my attempt doesn't do anything. Is there another way of doing it, where I can…
dan
  • 1,292
  • 2
  • 10
  • 16
80
votes
8 answers

Container Class / Library for C

Does anyone know of any C container libraries? I am looking for something which gives standard implementations of linked lists, arrays, hash tables etc, much in the same way as the C++ STL does. Key concerns are: Client code should be able to…
Howard May
  • 6,639
  • 9
  • 35
  • 47
79
votes
3 answers

What is an iterator's default value?

For any STL container that I'm using, if I declare an iterator (of this particular container type) using the iterator's default constructor, what will the iterator be initialised to? For example, I have: std::list
The Void
  • 857
  • 2
  • 7
  • 6
76
votes
3 answers

how to run amd64 docker images on arm64 host platform

I have an m1 mac and I am trying to run a amd64 based docker image on my arm64 based host platform. However, when I try to do so (with docker run) I get the following error: WARNING: The requested image's platform (linux/amd64) does not match the…
Sabo Boz
  • 1,683
  • 4
  • 13
  • 29
76
votes
5 answers

Flutter Layout Container Margin

I have a problem with my Flutter Layout. I have a simple container with a Margin right and left of 20.0 Inside this container i have another container. But this container does not fit to the parent container only on the left side. I dont know why…
M. Berg
  • 921
  • 2
  • 8
  • 11
76
votes
6 answers

Get Docker Container Names

This command gives me a list of running container IDs: docker ps -q Is there a command to get the list of names of the containers?
corey
  • 761
  • 1
  • 5
  • 3