4
голосов
10ответов
1701 просмотров

Which STL Container?

I need a container (not necessarily a STL container) which let me do the following easily: Insertion and removal of elements at any position Accessing elements by their index Iterate over the elements in any order I used std::list, but it won't let me insert at any position (it does, but for ...

7
голосов
4ответов
24825 просмотров

How can I get all controls from a Form Including controls in any container?

I need, for example, a way to disable all buttons in a form or validate all textboxes' data. Any ideas? Thanks in advance!

0
голосов
1ответов
404 просмотров

asking the container to notify your application whenever a session is about to timeout in Java

Which method(s) can be used to ask the container to notify your application whenever a session is about to timeout?(choose all that apply) A. HttpSessionListener.sessionDestroyed -- correct B. HttpSessionBindingListener.valueBound C. HttpSessionBindingListener.valueUnbound -...

2
голосов
3ответов
2136 просмотров

Can I use std::stack as object pool container?

I need to create a pool of objects to eliminate dynamic allocations. Is it efficient to use std::stack to contain pointers of allocated objects? I suspect every time I push the released object back to stack a new stack element will be dynamically allocated. Am I right? Should I use std::vector t...

2
голосов
6ответов
1030 просмотров

Should I expose iterators and adaptor methods or a whole container in C++?

Consider the piece of code: class Foo { // ... std::vector<Bar> bars; }; Should I expose the whole container, or should I expose typedef'd iterator class and write adaptor methods (begin(), end(), size(), and whatever I need)? If the answer is it depends, how should one make a decis...

2
голосов
2ответов
1961 просмотров

How to shutdown a servlet container from within a servlet?

Is there a portable way to request a Servlet container to shutdown gracefully, from within a servlet? By portable I mean a technique that will work on all standard compliant containers (Tomcat, Jetty, Winstone, etc). Note that this is the opposite of the Servlet.destroy() method, which gets cal...

1
голосов
2ответов
246 просмотров

Ada Ada.Containers Clear Procedure Problem

Has anyone had trouble with the Clear procedure found in the Ada.Containers package? It seems to set the Container's length to zero, but once another element is added using the Append procedure, the contents of the Container reappear (i.e. they never get removed). I've tried both Ada.Containers...

6
голосов
3ответов
3088 просмотров

How to create a container of noncopyable elements

Is there a way use STL containters with non-copyable elements? something like this: class noncopyable { noncopyable(noncopyable&); const noncopyable& operator=(noncopyable&); public: noncopyable(){}; }; int main() { list<noncopyable> MyList; //error C2248: 'no...

1
голосов
6ответов
872 просмотров

Container.remove(int i) throws unexpected ArrayIndexOutOfBoundsException

I'm trying to remove all but the first child component from a Java Container. The following code logs "There are 3" and throws an ArrayIndexOutOfBoundsException: Array index out of range: 2 int componentCount = cardPanel.getComponentCount(); logger.info("There are " + componentCount); for (int ...

2
голосов
1ответов
562 просмотров

C# Design template containers?

I have been trying to find a good guide to create a templated control. I am trying to display a few pictures on several different parts of my website so I wanted to add a template control to allow me to modify the HTML before it renders. Something like: <cc1:photos runat="server" id="myPhotos...

5
голосов
2ответов
8995 просмотров

Flex spacing inside vbox, hbox

children inside hbox and vbox have spacing between them, how do you remove this empty space? I need to have 0 space between child elements of a hbox or vbox

23
голосов
3ответов
40638 просмотров

How to specify Http Request timeout parameter on Java servlet container

I'm trying to understand where I can configure a request timeout for all requests arriving to a servlet of mine (or all of my servlets)? Is that, as I think, a container property? Also, how does this affect different browsers? Do they all comply to the parameter the container dictates? Or maybe ...

2
голосов
3ответов
3118 просмотров

c# file container

I am searching for a way to add several files into one file, much like a Zip file. I need to be able to create a file container on the fly and add several word documents, images and other important files into the container. My criteria is that you don't need to install any additional software on ...

12
голосов
4ответов
1949 просмотров

STL map onto itself?

I'd like to create a std::map that contains a std::vector of iterators into itself, to implement a simple adjacency list-based graph structure. However, the type declaration has me stumped: it would seem you need the entire map type definition to get the iterator type of said map, like so: ma...

0
голосов
2ответов
172 просмотров

Getting the Iterator for an inner STL Container?

I am having trouble trying to get iterators for inner sub-containers. Basically imagine this simplified code: typedef map<string, map<string, map> > double_map; double_map dm; .. //some code here for(double_map::iterator it = dm.begin(); it != dm.end(); it++){ //some code here...

0
голосов
1ответов
2978 просмотров

Zend Form and nested fieldsets/containers?

I have a form. I have a single element that needs to be wrapped in a div or fieldset (for formatting). Then I have two groups of elements, including the above, that I want to wrap in a fieldset or div. I've managed to create two groups, but Zend Form seems to balk at letting me create a group con...

0
голосов
1ответов
596 просмотров

Trying to adapt the Dojo Toolkit "Highlight Container"

I am using the "Highlight Container" effect in the Dojo Toolkit (as shown here). My problem comes when I have a DIV that contains a TEXTAREA instead of a text field. I am not sure how to get it to recognize either a text field or a textarea. The code function is as follows: dojo.addOnLoad(fun...

0
голосов
2ответов
214 просмотров

Taking iterators two at a time?

I'll often represent and process polylines like so: typedef std::vector< Point_t > Polyline_t; double PolylineLength(const Polyline_t& line) { double len = 0.0; for( size_t i = 0; i < line.size()-1; ++i ) len += (line[i+1]-line[i+0]).length(); return len; } Th...

30
голосов
13ответов
7784 просмотров

Why STL containers are preferred over MFC containers?

Previously, I used to use MFC collection classes such CArray and CMap. After a while I switched to STL containers and have been using them for a while. Although I find STL much better, I am unable to pin point the exact reasons for it. Some of the reasoning such as : It requires MFC: does not h...

2
голосов
2ответов
319 просмотров

Prefer Inheritance or Containment when creating specialized collections?

I have a need for specialized collection classes. Let's call them FooItems and BarItems. I basically need all the functionality of a List, but I need to do some extra work when new items are added or removed from the collection. My first stab at this was to simply derive from List and List, ...

21
голосов
6ответов
74230 просмотров

What are the containers in Java

Could anyone please give me a brief full list of containers in Java? Some of the ones I know are Array, Arraylist, Hashtable, HashMap, HashSet, Node, NodeList, TreeNode, and TreeMap.

0
голосов
3ответов
3371 просмотров

Can jQuery UI Dialog Box hold a video? (maybe a youtube video?)

I haven't seen any examples on the net. Was wondering if someone knows if there's one that exists or if it's even possible. thanx

20
голосов
4ответов
33066 просмотров

limit size of Queue<t> in C++</t>

I notice the thread of similar question: Limit size of Queue in .NET? That's exactly what I want to do, but I am not using .net but GNU C++. I have no reference to the base class in GNU C++, so java like super.***() or .net like base.***() will not work. I have been trying to inherit from queue c...

5
голосов
3ответов
6343 просмотров

Java Web Services Container

I have just started learning Java Web Services ( JAX-WS ) and have one question. The reference documentation always talks about Web Services container. My question is : What is a Web Services container and why do we need it. I saw a simple example of JAX-WS in book "java web services up and runni...

1
голосов
4ответов
700 просмотров

Criteria for selecting the right STL container for the job?

Do you just base your STL container selections on the following attributes? Searching/Updating Insertion and Deletion If not, what else do you base your selections upon? Is there any reference out there that lists how each container performs across all these different attributes?

0
голосов
1ответов
9563 просмотров

jquery onmouseover of an image/link shows a div at the same position (tooltip)

i want hover over an image -&gt; which is in an link during i'm over the image should popup (like a tooltip) an div, which i can fill also with some stuff - any idea?! $this is the link which includes an img: i found the image within and wanted to span a div above the image and make some jquery...

0
голосов
2ответов
162 просмотров

C# Container Question

I'm having a weird problem with adding stuff to my Container. Whenever I try to add the items it simply exits the while loop, even though isServer is still 1. I've tried to make a custom function, same result. Then i tried calling the Add(..) function directly and still same result. I don't see h...

3
голосов
4ответов
876 просмотров

C++ templated container class: How to best support both ordered and un-ordered item types?

I'm writing a templated C++ generic container class that can optionally maintain its contents in a well-defined order. Previously it used function pointers to order its contents in a sensible type-specific way, but I am attempting to change it to use templated functor arguments instead. Since ...

0
голосов
2ответов
1186 просмотров

C++ container of iterators and circular references

I'd like to create two containers that contain iterators to each other. I'd like to do this hopefully without introducing any intermediate/indirect types. Is this possible or do iterator types depending on knowing the size of the container's data type? Here is some sample code that I'd like to g...

3
голосов
2ответов
2853 просмотров

Joining keys/values from C++ STL associative containers

I have a join function that operates on STL strings. I want to be able to apply it to to a container like this: getFoos(const std::multimap&lt;std::string, std::string&gt;&amp; map) { return join_values(",", map.equal_range("foo")); In other words, find all matching keys in the collection...