set

Variable names of unordered set items without implied structure

This question will be asked in a specific form, but applies to a more general question, how to name unordered set items without implying any sort of structure. In terms of graph theory, a connected, undirected graph will contain vertices that are connected via edges. When creating an edge class with two member variables that are vertic...

Reaching listview from another form

I create my listview in my design part, not programmatically. Then I want to reach this listview's content when I pressed some button. In my main form, I created a public listview to return listview2 as in my design. public ListView lst { get { return listView2; } set { listView2 = value; } } Then in my other...

passing more data to std:set Comparison class

I have an std::set with the Compare class which requires additional parameter to compare keys. This variable parameter is determined in run-time and I pack it inside the set's keys just to make it accessible to Compare. However, the parameter logically belongs to the set rather than the keys so this solution looks awkward and duplicates...

boost::bind & std::set::count compile error

Hi, Could anybody point me, please, what the difference is between making functor of set::insert and set::count in the below fragment? typedef std::set<std::string> s_type; typedef std::pair<s_type::iterator, bool>(s_type::*insert_fp)(const s_type::value_type&); typedef s_type::size_type(s_type::*count_fp)(const s_type::value_type&); ...

ASIHTTPRequest and userInfo

According to the website for ASIHTTPRequest: If your requests are all of the same broad type, but you want to distinguish between them, you can set the userInfo NSDictionary property of each request with your own custom data that you can read in your finished / failed delegate methods. How do I set userInfo? NSURL *url...

Python: does the set class "leak" when items are removed, like a dict?

I know that Python dicts will "leak" when items are removed (because the item's slot will be overwritten with the magic "removed" value)… But will the set class behave the same way? Is it safe to keep a set around, adding and removing stuff from it over time? Edit: Alright, I've tried it out, and here's what I found: >>> import gc >>>...

Copying C Array into Java Array Using JNI

I have an array of unsigned integers in C and a java array of longs. I want to copy the contents of the unsigned integers to the java array. So far, the only function that I've found to do this is SetLongArrayRegion(), but this takes an entire buffer array. Is there a function to set only the individual elements of the java array? Th...

Segmentation fault from std::_Rb_tree_const_iterator<Type>::operator++

I get a segmentation fault when iterating over a set. The stack trace points to std::_Rb_tree_const_iterator<Type>::operator++ std::_Rb_tree_increment() but I get nothing more informative. The iterator is over a set returned by a function for (FactSet::factset_iterator fact_it = (*binSet_it).getDependencyGraph().getExtentionalFactSe...

Set properties of a class only through constructor

Hi , I am trying to make the properties of class which can only be set through the constructor of the same class ...

For how long the iterator returned by std::set.find() lives?

I need to keep track of std::set element by saving the iterator returned by set.find(). My questions is does insertion and removing other elements invalidates the obtained iterator? From a simple test I did I can see it is not, but I'd like to ensure this feature is by design. ...

PHP SimpleXML, how to set attributes ?

Hi, if you've got something like, <hello id="1" name="myName1"> <anotherTag title="Hello"> </anotherTag> </hello> <hello id="2" name="myName2"> <anotherTag title="Hi"> </anotherTag> </hello> How to change the attributes of, for example, hello id 2, to name="William" ? Or the title hi to hello ? Thanks a lot for your atention, H'...

Set collection preserving insertion order

I need a collection that behaves as Set and preserves order of element insertion. Is there one or I'll have to implement it myself? What would the best implementation be? ...

Memory Leaks - STL sets

I am trying to plug up all my memory leaks (which is massive). I am new to STL. I have a class library where I have 3 sets. I am also creating a lot of memory with new in the library class for adding info to the sets... Do I need to deallocate the sets? If so, how? Here is the library.h #pragma once #include <ostream> #include <m...

Hibernate - how to map an EnumSet

Hi all, I've a Color Enum public enum color { GREEN, WHITE, RED } and I have MyEntity that contains it. public class MyEntity { private Set<Color> colors; ... I already have a UserType to map my Enums. Do you know how to map a Set of Enums in the Hibernate hbm.xml? Do I need a UserType or there's an easiest way? Thanks ed...

Efficient algorithm to find a maximum common subset of two sets?

Each set contains bunch of checksums. For example: Set A: { 4445968d0e100ad08323df8c895cea15 a67f8052594d6ba3f75502c0b91b868f 07736dde2f8484a4a3af463e05f039e3 5b1e374ff2ba949ab49870ca24d3163a } Set B: { 6639e1da308fd7b04b7635a17450df7c 4445968d0e100ad08323df8c895cea15 a67f8052594d6ba3f75502c0b91b868f } The maximum common subset ...

how to set font to grid in extjs

i want to set a DVB-TTYogesh Normal (true type) font to grid. for that i added the following to grid, style:'font-family:DVB-TTYogesh'. but the data in the grid still show "pcmcÁÖß´Ö.³ÖÖêÃÖ»Öê" like this and i want it in actualform ...

How should I declare a constant set visible for every instance of the class?

I would like to have a constant set in my class which would be visible for all instances of the class. First, I do not know if I need to declare it as "static". As far as I understand any changes of a static field (done by one of the instances) will be seen by other instances (so static variable is not bound to a specific instance). Mor...

Silverlight -RIA Services-This EntitySet of type <> does not support the 'Add' operation.

In Silverlight project I have this exception when I tried to Add a new object to a DataGrid when a button is clicked. In the DomainService class.. I know I have to implement the Add operation for the new Entity I'm putting, but how can I do that? I mean I did the class, the get method but how do I do the insert operation, I can't see m...

flex: cant edit item in Datagrid with override set data method

Hi everybody, I've a custom itemRenderer for my datagrid. To set the actual data I use the following method: override public function set data(side:Object):void{ ... } As soon as I use this function the cell doesn't show up any item Editor anymore. Why is that? When I remove this function the itemEditor is working but with the wro...

Finding unique maximum values in a list using python

Hi I have a list of points as shown below points=[ [x0,y0,v0], [x1,y1,v1], [x2,y2,v2].......... [xn,yn,vn]] Some of the points have duplicate x,y values. What I want to do is to extract the unique maximum value x,y points For example, if I have points [1,2,5] [1,1,3] [1,2,7] [1,7,3] I would like to obtain the list [1,1,3] [1,2...