Hi, i'm tring to put a list of recommended items in checkout cart page, i was trying to use the related products block that is in layaout/catalog.xml, but it works for a single product in product view page, and in the checkout cart page can be more than one product, so, how can i make something like this, if it can be done??
...
Hello,
I am grouping data in a WPF DataGrid. that takes very long so I want to show a Loading bar/adorner.
I am using MVVM. How would you remove/fade out the loading bar/adorner when the datagrid has finished the grouping.
How do I get the moment when the Data is grouped 100% ? Can this somehow be set in xaml or retrieved etc... ?
...
What is the difference between CopyOnWritearraylist and Collections.synchronizedList(..)? When should one be preferred over the other.
...
I have a dictionary whose values I'd like to return to a caller like this:
public ICollection<Event> GetSubscriptions()
{
return isLockDown ? Enumerable.Empty<Event> : subscriptionForwards.Values;
}
Unfortunately, the empty enumerable type is not compatible with the stated return type. Is there another BCL facility for this?
p.s...
Let us have the following code:
public class TestGenerics {
static <T> void mix(ArrayList<T> list, T t) {
System.out.println(t.getClass().getName());
T item = list.get(0);
t = item;
System.out.println(t.getClass().getName());
}
public static void main(String[] args) {
ArrayList<Object>...
I've used BackgroundWorkers quite a bit, but I've never experienced this problem before. My program analyses the output from a logic analyser producing packets, of which there are thousands. To prevent too much delay updating the ListView in my form (I was previously reporting each one as it was found, and the form was completely unrespo...
Hi,
How to compare and sort different type of objects using java Collections .Below is the use case:
For example DOG,MAN,TREE, COMPUTER,MACHINE - all these different objects has a common property say "int lifeTime". Now I want to order these obects based on the lifeTime property
Thx
...
List<String> listA = new ArrayList<String>();
listA.add("a");
listA.add("b");
listA.add("c");
listA.add("d");
List<String> listB = new ArrayList<String>();
listB.add("c");
listB.add("d");
listB.add("e");
listB.add("f");
ListB contains two elements that are also present in ListA ("c" and "d").
Is there a clean way to make sure that ...
Problem too specific.closing the same.
...
Hi all, there is a way to test if a collection is already initialized? try-catch only?
I have a function work with a lazy collection, and i need to load it only if is not already loaded.
Thanks you.
...
Is there a specific collection type in .NET which allows storing a limited number objects and removing the oldest element automatically? What's the easiest way to implement such "Recent Files" functionality?
...
Hello!
I have a simple DataGrid. I want to make that every DataGridRowHeader has it own Content.
I specified RowHeaderStyle like this:
<DataGrid.RowHeaderStyle>
<Style TargetType="DataGridRowHeader">
<Setter Property="Content" Value="{Binding Source={StaticResource RowHData}, Path=Parameters}"/>
</Style>
</DataGrid.RowHeader...
Anyone know of a good implementation of a MultiValueDictionary? Basically, I want want something that allows multiple values per key. I want to be able to do something like
dict.Add(key, val);
And if the key doesn't already exist, it will add it, if it does, it will just add another value to that key. I'm just going to iterate over it...
I found a blog post today that mention's scalaz's sequence function.
Couldn't you do something as simple as:
if (l contains None) None else l
If so, what would this function signature look like? contains is in SeqLike, right?
Also, from the blog post I thought sequence was going to be something similar to map, but one that would br...
Hi, I have an the following scenario:
// several classes that implement different interfaces
class A implements X,Y {}
class B implements Y,Z {}
class C implements X,Z {}
// other classes that contain collections of one of the interfaces(different objects)
class G {
Collection<X> mayContainAC;
}
class H {
Collection<Y> mayContainA...
Is there a way to have a class collection of inherited types be initialized?
For example, here is my code:
Public Class CamryCar
Property Name As String = "Camry"
Property Color As String
End Class
Public Class RedCamry
Inherits CamryCar
Sub New()
MyBase.New()
Color = "Red"
End Sub
End Class
Public...
Why do many Collection classes in Java extend the Abstract class and also implement the interface (which is also implemented by the given abstract class)?
For example, class HashSet extends AbstractSet and also implements Set, but AbstractSet already implements Set.
...
I know I can solve the following problem just by creating a custom class, but can the following be strongly typed as a List(or any other type)?
var x = new object[]
{
new object[] { new Image(), new TextBox(), new FileUpload() },
new object[] { new Image(), new TextBox() , new FileUpload()}
...
This might be a super easy answer, since I'm sure it's not uncommon. I see some similar questions, but nothing that seems to describe my problem.
I have two objects: a car and person. They're in a many-to-many relationship, i.e. a car can be owned by multiple people, and a person can own multiple cars. Car has a lazily initialized se...
public static int SafeCount<T>(this IList list)
{
return list != null ? list.Count : 0;
}
What I want to ask is what should I call this method? SafeCount? NullSafeCount?
Can you come up with something more short yet non-ambigous?
...