containers

How to add a Global runtime service to System.ComponentModel.Container ?

Hi ! Suppose the .NET Component Model. The Container class has GetService(Type service); But I'm asking myself, how can I register Global Services accessible to all added Components ? ...

Java Application/Thread Server

I am looking for something very close to an application server with these features: it should handle a series of threads/daemons, allowing the user to start-stop-reload each one without affecting the others it should keep libraries separated between different threads/daemons it should allow to share some libraries Currently we have ...

Could the assign function for containers possibly overflow?

I ran into this question today and thought I should post it for the community's reference and/or opinions. The standard C++ containers vector, deque, list, and string provide an assign member function. There are two versions; I'm primarily interested in the one accepting an iterator range. The Josuttis book is a little ambiguous with ...

forcing a child component to resize itself larger than its container

I am creating a component that displays a variable amount of "gauges" (square tiles of content if you will), that is laid out like so: <HDividedBox id="container"> <VBox id="myComponent"> <HBox id="header"> ...header content... </HBox> <Tile id="body"> ...gauges are added to the body... </Tile> ...

Simple CSS height problem

Hello! I am trying to just create a basic layout, but i am having trouble to get it to auto-adjust the height. Something is wrong with the DIV-container since it's not adding the padding correctly to the top and bottom elements. It should be the size of the highest block, right now its the menu block. Any ideas? Website ...

regarding C++ stl container swap function

I recently learned that all stl containers have swap function: i.e. c1.swap(c2); will lead to object underlying c1 being assigned to c2 and vice versa. I asked my professor if same is true in case of c1 and c2 being references. he said same mechanism is followed. I wonder how it happens since c++ references cannot be reseted. ...

C++: need indexed set

I need an indexed associative container that operates as follows: initially empty, size=0. when I add a new element to it, it places it at index [size], very similar to a vector's push_back. It increments the size and returns the index of the newly added element. if the element already exists, it returns the index where it occurs. S...

How do I programmatically add a widget to a container created from GtkBuilder?

I've created a window that has some containers and widgets in it, and I want to add a new widget dynamically at run-time to one of the Vboxes in this window. So I have this code, which brings up the window: gtk_builder_add_from_file( g_builder, "window.xml", NULL ); mainwindow = GTK_WIDGET( gtk_builder_get_object( g_builder, "window"...

What container is easiest for combining JPEGS and MP3s as video?

So I have N (for example, 1000) JPEG frames and 10*N ( for example, 100) seconds of MP3 sound. I need some container for joining them into one video file (at 10 frames/second) (popular containers like FLV or AVI or MOV are better). So what I need is an algorithm or code example of combining my data into some popular format. The code exa...

Is there any Container for playing MJPEG and MP3 as video?

So I have MP3 track and MJPEG Is there any container for combining those 2 and playing them as one video track in one container? ...

Is there any Good opensource not C\C++ library for playing with FLV container?

Is there any Good opensource not C\C++ library for playing with FLV conteider? So I need it in AS3 but Java or C# will be fine=) I need to be able to put in flv audio track andsome bitmaps (with some exact timestamps relativly to my audio track) So Is there ay or I have to implement all bymy self just reading spetificatiopon? ...

FLV container. How to add mp3 as audio track?

So I have an mp3 file. I have some frames inserted. Now I Need to insert this track as flv sound. How to du such thing (for frames insert I use this class http://www.zeropointnine.com/blog/simpleflvwriteras-as3-class-to-create-flvs/ ) ...

Copy method optimization in compilers

Hi All! I have the following code: void Stack::operator =(Stack &rhs) { //do the actual copying } Stack::Stack(Stack &rhs) //copy-constructor { top=NULL; //initialize this as an empty stack (which it is) *this=rhs; //invoke assignment operator } Stack& Stack::CopyStack() { return *this; //this statement will invoke co...

Which containers / graphics components to use in a simple Java Swing game?

I'm creating a simple labyrinth game with Java + Swing. The game draws a randomized labyrinth on the screen, places a figure in the middle, and the player is then supposed to find the way out by moving the figure with arrow-keys. As for now, I'm using a plain background and drawing the walls of the labyrinth with Graphics.drawLine(). I h...

Containers of reference_wrappers (comparison operators required?)

If you use stl containers together with reference_wrappers of POD types, code such as the following works just fine: int i = 0; std::vector< boost::reference_wrapper<int> > is; is.push_back(boost::ref(i)); std::cout << (std::find(is.begin(),is.end(),i)!=is.end()) << std::endl; However, if you use non-POD types like (contrived example)...

C++ design question, container of instances and pointers

Hi all, Im wondering something. I have class Polygon, which composes a vector of Line (another class here) class Polygon { std::vector<Line> lines; public: const_iterator begin() const; const_iterator end() const; } On the other hand, I have a function, that calculates a vector of pointers to lines, and based on those lines...

C++ STL containers

Different STL containers like vector, stack, set, queue, etc support different access methods on them. If you are coding for example in Notepad++ or vim, you have to continuously refer to the documentation to see what all methods are available, atleast I have to. Is there some good way of remembering which container supports which meth...

Singleton design pattern vs Singleton beans in Spring container

As we all know we have beans as singleton by default in Spring container and if we have a web application based on Spring framework then in that case do we really need to implement Singleton design pattern to hold global data rather than just creating a bean through spring. Please bear with me if I'm not able to explain what I actually ...

Changing a Container while using Visitor

Hi everyone, I implemented the Visitor pattern in C++ using a STL-like iterator for storing the Visitor's current position in the container. Now I would like to change the container while I iterate over it, and I'm especially interested in deleting items from the container, even the one I'm currently visiting. Now obviously this will i...

friendship and operator overloading help

hello there, I have the following class #ifndef Container_H #define Container_H #include <iostream> using namespace std; class Container{ friend bool operator==(const Container &rhs,const Container &lhs); public: void display(ostream & out) const; private: int sizeC; // size of Container int capacityC; ...