I am playing with matplotlib - I have a bar chart, and I want to highlight the bar which user clicks. I have a callback that goes through a rect collection (the one I got from self.axis.bar(...)) and finds out which one was clicked (looking at the coordinates). At this point I want to call something to change the colour of the current bar. Is it…
I'm fairly new to OOP in PHP, I've made a couple of basic scripts but nothing impressive. All I've really taken from it is that it would probably be easier just make a collection of functions and include them.
The structure of classes seems to just confuse what was otherwise a simple process. And in collating everything into a class it doesn't…
Hi,
is it possible to read the value of an IdentityTag if you place it on the TagVisualizer, without having initalized it before?
I would like to use the tags for registering a new object on the Surface but having all the "free" IdentityTags in a Collection for initalizing them all... There must be a better way to do in I think.
But the…
I have a music collection and use sphinx for searching in it. Search mode is SPH_MATCH_PHRASE, but when I search f.e. for "B'Day" album - sphinx cuts "'" and searching by "Day" query. How can I force sphinx to search by exact phrase without filtering any symbols?
I understood,normally generics is for compile time safe and allow us to keep strongly typed collection.Then how do generic allow us to store anonymous types like
List<object> TestList = new List<object>();
TestList.Add(new { id = 7, Name = "JonSkeet" });
TestList.Add(new { id = 11, Name = "Marc Gravell" });
TestList.Add(new {…
I have a WPF ListBox control and I'm setting it's "ItemsSource" to a collection of item objects. How can I bind the "IsSelected" property of the ListBoxItem to a "Selected" property of a corresponding item object without having an instance of the object to set as a binding.Source?
Is there a tool which could be used to analyse the objects being created between two separate garbage collection run (= number of objects created and their type) ?
Heapdumps dont really work here as they perform a GC when they're invoked (or at least that's what I observed everytime so far), and I want to see which objects are collected…
I am using VS2010, CrystalReport13 & MVC3. My problem is unable to add an external assembly in Crystal Report using "Database Expert" Option.
I have a class named WeeklyReportModel in an external assembly. In my web project, data retrieving from DB as IEnumerable collection of WeeklyReportModel.
I tried ProjectData - .NetObjects in…
I know that the Apple Mac OS .app file is a collection of programs and data. I guest the iPhone is similar in this way. I can unzip a Mac OS .app to find the resource , images using this way. Can the iPhone App do the similar thing? I mean, can the user unzip the iPhone .app to get the resource/ img from that? thz.
If I wanted to do something like this:
collection.each do |i|
return nil if i == 3
..many lines of code here..
end
How would I get that effect? I know I could just wrap everything inside the block in a big if statement, but I'd like to avoid the nesting if possible.
Is there any difference in (asymptotic) performance between
Orders.OrderBy(order => order.Date).First()
and
Orders.Where(order => order.Date == Orders.Max(x => x.Date));
i.e. will First() perform the OrderBy()? I'm guessing no. MSDN says enumerating the collection via foreach och GetEnumerator does but the phrasing does…
How to filter nested/child collections of entities when including them in EF?
Example:
Let's have standard Customer-Orders association. How to load all customers and include only their last three orders in their Orders collection?
Is there something like AssociateWith function from L2S for EF?
I'm building a simple program to use in multi processes (Threads).
My question is more to understand - when I have to use a reserved word synchronized?
Do I need to use this word in any method that affects the bone variables?
I know I can put it on any method that is not static, but I want to understand more.
thank you!
here is…
What I need is a collection which allows multiple keys to access a single object.
I need to apply frequent alterations to this object.
It also must be efficient for 500k+ entries.
I have problem with JavaConversions with 2.8 beta:
import scala.collection.JavaConversions._
class Utils(dbFile : File, sep: String) extends IUtils {
(...)
def getFeatures() : java.util.List[String] = csv.attributes.toList
}
And then exception:
[INFO] Utils.scala:20: error: type mismatch;
[INFO] found : List[String]…
Run this:
for i in range(1000000000):
a = []
It looks like the list objects being created never get marked for garbage collection. From a memory profiler, it looks like the interpreter's stack frame is holding onto all the list objects, so GC can never do anything about it.
Is this by design?
Suppose I have some code that looks like this:
Private Sub MySub()
dim blnFlag as Boolean
blnFlag = False
for each item in collection
if item.Name = "Mike" then
blnFound = true
exit for
endif
next item
End Sub
Now - the blnFLag = False assignment is not actually…
Hi all!
I am having problems using the update method of scala.collection.immutable.HashMap.I don't see the reason it returns a Map instead of a HashMap. How do I get a new HashMap with a new key-value pair added?
Why are the methods contains() and indexOf() in the Java collections framework defined using o.equals(e) and not e.equals(o) (where o is the argument of the methods and e is the element in the collection)?
Anyone know the reasons of that?
I want to define something like this
<myCustomControl>
<myCustomControl.Images>
<Image
Source="{StaticResource LockedIcon16}" />
<Image
Source="{StaticResource UnlockedIcon16}"/>
<myCustomControl.Images>
<myCustomControl/>
what property definitions do i need…
Hello,
i have collection of IEnumerable (sentence = string)
i want to split all sentences to words (ex: .Select(t = t.Split(' '));
and after i need group this query by words to get list of unique words.
Please, Help
I have a base class that declares a grouping of objects. That grouping can be an array, List, Collection, that's up to me.
The derived classes of this base class are the ones that actually set the values of this multi-element field. What is the best way to expose this field to the derived classes?
What is the advantage of using a ConcurrentBag(Of MyType) against just using a List(Of MyType)?
The MSDN page on the CB (http://msdn.microsoft.com/en-us/library/dd381779(v=VS.100).aspx) states that
ConcurrentBag(Of T) is a thread-safe
bag implementation, optimized for
scenarios where the same thread will
be both…
Let's say I have composite hierarchical structure. Each object in the structure has child collection of the same objects. Each object has XPath property, which stores the exact xpath to the element inside XML file. Right now I am trying to create an extension, which can generate XML string from that hierarchical structure,…