I've seen this question posted here previously but I'm not satisfied that I understand the complete ramifications. The problem is what return type should a data layer that uses linq-to-sql return for maximum flexibility and query ability. This is what I've read/found:
IEnumerable is limited and only allows for read forward operation. I...
is any way to optimize this solution?
whether there is any possibility of obtaining the same result by calling single query?
public List<Company> GetCompanies(DateTime maxDate, int stockQuotesCount)
{
List<Company> result = new List<Company>();
IList<Company> company = null;
DateTime lastSessionDate = new St...
LinkeSetFx has its own CollectionEvent, but I don't know how to map the LinkedSetFx event to mx.events.collectionEvent(I want use it in ComboBox). LinkedSetFx is in AS3Commons-collection framework.Here is the url, choose the as3commons-collections-1.0.0.zip, you'll find LinkedSetFx in src\org\as3commons\collections\fx
...
Hi, i have a class Auswahl with some plain properties and a property RefFilters of type
List<RefAuswahlFilter>
What i want to achieve is: Display all Auswahl Properties in a datagrid with all RefFilter items in ONE row. the Problem is, the count of RefFilter is different from auswahl to auswahl object. in the past i use a datatable as...
I've noticed in other people's code that methods returning generic collections will almost always return an interface (e.g. IEnumerable or IList) rather than a concrete implementation.
I have two related questions. Firstly, why (if at all) is it considered better to return an interface? Secondly, is there a collection interface that inc...
I found that java.util.Arrays.sort(Object[]) use 2 kinds of sorting algorithms(in JDK 1.6).
pseudocode:
if(array.length<7)
insertionSort(array);
else
mergeSort(array);
Why does it need 2 kinds of sorting here? for efficiency?
...
Hi!
I need to check, if procedure parameters are null, and if not, to use it in WHERE clause. For example:
sqlquery := 'SELECT * FROM table WHERE a_col = a AND';
IF b IS NOT NULL THEN
sqlquery := sqlquery || ' b_col = :b';
END IF;
IF c IS NOT NULL THEN
sqlquery := sqlquery || ' c_col = :c';
END IF;
And so on.
Then I need to use O...
Hi, i'm learning by practice. I was given an OCX file which according to who gave it to me was created using VB6 and I have the task of creating a user interface for it to test all the functionality that is described in a poorly written documentation file. On top of that I am not well-versed in VBScript but I've managed to dodge a few bu...
Given a List of MyClass objects (and a custom Comparitor myComparitor if needed), what good options are there for checking if the List contains two "equal" objects?
Edit: if there are duplicates, return a reference to one or more of the duplicates.
Overriding MyClass.equals(MyClass) in this case is not an option.
My initial thought is...
Does the entrySet() function that is called from a treemap instance return a TreeSet of entry's or simply a set of entry's.Is the order ensured?
Instead of getting it as a set of entry's how can a get a list of entry's in order?
...
Hello I turned on garbage collection (objective-c 2.0) and the image for the status item disappeared when I restarted my application. I am manually memory managing the image and status item. This application works normal when garbage collection is off. Is there a way to make the garbage collection not collect specific variables or sho...
I have an array of sorted integers, and I'd like to get the two consecutive indices of elements that bound a particular value I pass in. To illustrate, because it's hard to describe in words, let's say I have an array (regular zero-indexed):
1 3 4 5 7 9
I want to get the two indices that bound, say, the value 6. In this case, the arra...
PK_RPM_BTN_SETTING_ID FK_BUTTON_ID FK_ITEM_OR_PKG IS_ITEM_OR_PKG SORT_ORDER
--------------------- ------------ -------------------- -------------- ----------
1 1 1 I 1
1 2 1 P 2
1 3 ...
Are they AVL trees, red-black trees, or something else?
...
Just now find it by chance, Add(T) is defined in ICollection<T>, instead of IEnumerable<T>. And extension methods in Enumerable.cs don't contain Add(T), which I think is really weird. Since an object is enumerable, it must "looks like" a collection of items. Can anyone tell me why?
...
I have this class
public class Item
{
public int UniqueKey;
public int Key1;
public int Key2;
public int Key3;
public int Key4;
public string Value;
}
and the collection IEnumerable<Item>
I want to create indexes on items of this collection by Key1, or by Key2, or composite one (Key1 and Key4). The number of ...
i am looking for a particular element in a collection. how do i know if it exists in the collection?
...
When is it acceptable for an indexer to automatically add items to a collection/dictionary? Is this reasonable, or contrary to best practices?
public class I { /* snip */ }
public class D : Dictionary<string, I>
{
public I this[string name]
{
get
{
I item;
if (!this.TryGetValue(name, out...
Does anyone know how to sort a collection in VBA?
...
I have vsort and vsorta, both lists with equal numbers of items that should be right next to each other (about 250 elements per list). I want to print them as parallel columns, like so:
>>> for x,y in vsort,vsorta:
... print x, y
...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: too many value...