containers

Which one to use c++ stl container or the MFC container?

For every stl container there is a MFC container available in visual c++.Which is better than the other one in what sense and what do you use? I always use STL container is that wrong? ...

How can I write a generic container class that implements a given interface in C#?

Context: .NET 3.5, VS2008. I'm not sure about the title of this question, so feel free to comment about the title, too :-) Here's the scenario: I have several classes, say Foo and Bar, all of them implement the following interface: public interface IStartable { void Start(); void Stop(); } And now I'd like to have a contai...

Object delete itself from container

So I have a container(any kind, probably std::map or std::vector) which contains objects of a class with some network thing running in a thread that checks if it is still connected (the thread is defined inside that class and launches when constructed). Is there any way I can make the object delete itself from the container when its dis...

How to create a simple Custom Container control with 2 Divs inside?

Hi Guys Im looking to create a custom ASP.NET container control that will allow me to drag further controls into it within the VS designer. The final HTML that im looking for is very simple.. <div id="panel1"> <div id="panel2"> </div> <div id="panel2"> </div> </div> With additional controls being able to be dragged i...

How have you used IContainer/ISite/IComponent in your own code?

There are various online docs about using IContainer and ISite (eg http://www.theserverside.net/tt/blogs/showblog.tss?id=pluginArchitectures), and there are vague examples around, but I haven't come across a real instance (other than winforms) where it is actually useful. It doesn't help that I don't really know what exactly it can be us...

Step through controls fail to see second dropdown

I have an ASP.net table. In several cells I have two dropdown lists. The item selected in each dropdownlist is supposed to be populated from an SQLServer 2005 database. To do this in my code behind I step through the controls in each table cell. The code sees the first dropdown and populates it and then goes to the next cell. My ASP...

Order like a list but access by a key?

I used list to place cities into a trip. Then I iterate over the list to display the trip itinerary. I would like to access the cities by the name rather than by the trip order. So, I thought I could use a map rather than a list but the key determines the order. I would still like to control the order of the sequence but be able to acces...

How do I create a custom panel with a checkbox in ASP.NET

I want to create a custom container control in ASP.NET (similar to a Panel) with a check box as a header that disables all contained controls when unchecked. How would I go about doing this? EDIT: To expand on my requirements, I need something like Rob suggested, i.e. a UserControl containing a CheckBox and a content panel. However, ...

C# Containers -- Filling a Space Vertically on Resize

I'm new to C# and I've been working on a small project to get the feel with Visual Studio 2008. I'm designing the GUI in C#, and I have a TabControl with three GroupBoxes. These three GroupBoxes are anchored to the left and right of the screen and work perfectly when resized horizontally. I would like these three boxes to take up 33% of...

Is there a way in Python to index a list of containers (tuples, lists, dictionaries) by an element of a container?

I have been poking around for a recipe / example to index a list of tuples without taking a modification of the decorate, sort, undecorate approach. For example: l=[(a,b,c),(x,c,b),(z,c,b),(z,c,d),(a,d,d),(x,d,c) . . .] The approach I have been using is to build a dictionary using defaultdict of the second element from collections...

size_t vs container::size_type

I'm wondering if there's a difference in using size_t and container::size_type? What I understand is size_t is more generic and can be used for any size_types.. Is container::size_type more optimized for a specific container though? ...

MS Access AutoNumber on Import

Just curious, when I imported data from a spreadsheet with 519 lines into an empty table, why did my autonumber keys start at 56,557,618? How big can this get? I don't want to end up running out of digits for my primary key field as I didn't even start on the project and I expect to be dumping spreadsheets in quite regularly. ...

How do you efficiently implement the observer pattern if the subject is a huge container?

We all know the observer pattern: You have a subject which is able to notify and update a list of observers of its state changes. Now suppose that the subject you would like to observe is a container, and you would like to observe the container itself, i.e. element addition and deletion of elements, and also the contained elements, i.e. ...

Is the linked list only of limited use?

I was having a nice look at my STL options today. Then I thought of something. It seems a linked list (a std::list) is only of limited use. Namely, it only really seems useful if The sequential order of elements in my container matters, and I need to erase or insert elements in the middle. That is, if I just want a lot of data and ...

c++ set versus vector + heap operations for an A* priority queue

When is using a std::set more efficient (w.r.t. time) than using a std::vector along with make_heap/push_/pop_ for the priority queue in an A* operation? My guess is that if the vertices in the open list are small, using a vector is a better option. But does anyone have experience with this? ...

(STL) Container of pointers

I'm having some trouble in declaring a STL Set of pointers to class instances. More specifically, I have this scenario: class SimulatedDiskFile { private: // ... public: // ... struct comparator { bool operator () (SimulatedDiskFile* const& file_1, SimulatedDiskFile* const& file_2) { return ((*file_1)->getF...

C++ Container / Iterator Dependency Problem

Hello :) I'm working on an container class that looks something like this: class hexFile { public: HANDLE theFile; unsigned __int64 fileLength; hexFile(const std::wstring& fileName) { theFile = CreateFile(fileName.c_str(), GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_DELETE | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FI...

Emulating membership-test in Python: delegating __contains__ to contained-object correctly

Hi, I am used to that Python allows some neat tricks to delegate functionality to other objects. One example is delegation to contained objects. But it seams, that I don't have luck, when I want to delegate __contains __: class A(object): def __init__(self): self.mydict = {} self.__contains__ = self.mydict.__contains_...

DNN Containers

Hi, This might be a general question, but I can't seem to figure it out. What are containers in DNN? Skins are essentially a layout plus a colour scheme for the whole portal. So are containers the skin for desktopmodules? Sorry if this question is novice. I am not confident in DNN yet, and am reading the doco. However i need this answe...

Does Caliburn provide a way to get a reference to the container from anywhere?

Hi! I'm currently messing around with Rob Eisenberg's Caliburn framework. When looking at the documentation that is provided on http://caliburn.codeplex.com there is an example of how to resolve a Caliburn service from the container. It's something along the lines of this: SimpleContainer container = new SimpleContainer(); CaliburnFr...