bag

NHibernate child objects update problem

I have an object that called 'category' and the table looks like this. CATEGORY ID int ParentCatalogID int ParentCategoryID int << This is the ID of this table Position int Title nvarchar(128) Description nvarchar(1024) LastUpdated datetime DateCreated datetime IsActi...

Objective-C implementation of a histogram or bag datastructure

Instead of implementing my own I was wondering if anyone knows of a histogram or bag datastructure implementation in Objective-C that I can use. Essentially a histogram is a hashmap of lists where the lists contain values that relate to their hash entry. A good example is a histogram of supermarket items where you place each group of it...

finding kth largest element in an array implemented bag

we have a collection of comparable held in a bag and have to find the kth largest element. I copied to a hashSet to remove duplicates then converted the hash set to an array to be sorted and consequently the kth element accessed. its compiling but fails the testing, and I can't figure out whats wrong. any ideas? public E kth(int K){ ...

How might a class like .NET's ConcurrentBag<T> be implemented?

I find myself very intrigued by the existence of a ConcurrentBag<T> class in the upcoming .NET 4.0 framework: Bags are useful for storing objects when ordering doesn't matter, and unlike sets, bags support duplicates. My question is: how might this idea be implemented? Most collections I'm familiar with essentially amount to (under...

HIBERNATE: Load multiple collections in single select.

Hello, I have the following class-mapping that contains multiple collections mapped as : Code: <class entity-name="tab_a" table="tab_a" lazy="true" schema="dbo" dynamic-update="false" dynamic-insert="false" select-before-update="false"> <id name="tabid" type="string" column="`TABID`"> <generator class="nativ...

Are there any implementations of multiset for .Net?

I'm looking for a .Net implementation of a multiset. Can anyone recommend a good one? (A multiset, or bag, is a set that can have duplicate values, and on which you can do set operations: intersection, difference, etc. A shopping cart for instance could be thought of as a multiset because you can have multiple occurrences of the same pr...

hibernate empty collection in component

I have a component mapped using Hibernate. If all fields in the component in the database are null, the component itself is set to null by hibernate. This is the expected behavior and also what I need. The problem I have, is that when I add a bag to that component, the bag is initialized to an empty list. This means the component has a ...

Nhibernate custom loader for collection

Im really hoping someone can help with this, have been trying various combinations for a day and a half now.... Basically I have a some hierarchical data stored in a single table, the usual parentID maps to a row id scenario. I have modelled a property within the domain object that returns a list of ancestors for a given item. It all s...

NHibernate bag - real collection items instead of proxies

Hi all, I am experiencing some strange problems with NHibernate and the usage of proxy items within a bag. My mapping looks something similar to: <?xml version="1.0" encoding="utf-8" ?> <bag name="Markets" table="ITPUserWatchlistMarkets" cascade="none" lazy="false"> <key column="UserWatchlistId" /> <many-to-many class="Swan.Dom...

Fluent Nhibernate - How do I set the name attribute of a set or bag collection?

This is a set collection: <set access="field.camelcase-underscore" cascade="save-update" inverse="true" lazy="true" name="employees" table="TeamEmployee" mutable="true"> How do I set the name attribute? ...

SharePoint 2007 property bag content deplyment

Does anyone know if the property bag settings for a sharepoint 2007 site is included in content deployment? my google foo has failed me today for a solidified answer. ...

What is an efficient algorithm for extracting bags from lists of pairs?

I have a list of pairs of objects. Objects can appear in the pair in either order. What is the most efficient algorithm (and implementation?) to find all bags (ie sets with duplicates permitted) of pairs between the same objects. For my purpose the object references can be assumed to be pointers, or names or some similar convenient, shor...