Collection Framework [closed] - collections

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 12 years ago.
Difference between HashSet and TreeSet?

You should check the JavaDoc of both classes. They are different in various aspects.
As an example, ordering:
TreeSet:
A NavigableSet implementation based on a TreeMap. The elements are ordered using their natural ordering, or by a Comparator provided at set creation time, depending on which constructor is used.
HashSet:
This class implements the Set
interface, backed by a hash table
(actually a HashMap instance). It
makes no guarantees as to the
iteration order of the set; in
particular, it does not guarantee that
the order will remain constant over
time. This class permits the null
element.

Take a look at the Java Tutorials trail on Set Implementations, from which I quote:
HashSet is much faster than
TreeSet (constant-time versus
log-time for most operations) but
offers no ordering guarantees. If you
need to use the operations in the
SortedSet interface, or if
value-ordered iteration is required,
use TreeSet; otherwise, use
HashSet. It's a fair bet that you'll
end up using HashSet most of the
time.

Related

Compare two xmls using xquery [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I have two xmls, say Sample1.xml and Sample2.xml. Now I need to compare both the xml values (parent nodes, child nodes, attributes and its values) and return the differences between them in xquery. I knew I can use deep-equal function to say if the xmls are identical. But I do not know how to compare and return the xml difference.
Please help.
Thanks,
-N
Depending on the degree of generality we're talking about here, this is a non-trivial problem (PDF). If your question is, "how do I write this algorithm," then it's way too open-ended for StackOverflow (see the FAQ). If, on the other hand, you are asking, "Is there any XQuery library code out there that will do this," then it appears that simply Googling "XML difference XQuery" will lead you straight to the answer. Faster, even, then having someone else do the Googling for you on Stack Overflow.

Is there any possibility to generate random numbers using XQuery? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I have to generate a series of random numbers using XQuery.I found a set of libraries but those are paid.If anyone can give me a direction it would be much appreciated(preferably code).
The standard XQuery languages provides no random function, but many implementations do. Some examples for open source implementations:
BaseX provides a Random Module
Zorba has a Random Module, too
eXist-db has some suitable functions in the Util Module
MarkLogic provides the xdmp:random() function
As an alternative, most Java implementations of XQuery (such as BaseX, Saxon or Qizx) provide so-called Java bindings in order to evaluate Java code:
declare namespace math = 'java:java.lang.Math';
math:random()
If the implementation support the latest XQuery 3.0 specification, this can also be written as a one-liner:
Q{java:java.lang.Math}random()

How would one build a model of their project? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I've been asked to model my application. I'm not clear what this means, Perhaps something related to the architecture of my project?. Does it mean giving them a break-up of the classes? Or something like building a use-case or class diagram? Or perhaps something else?
EDIT: I cannot ask them!
I'd go with UML (Unified Modelling Language). It allows you to lay out classes, methods, inheritance, etc. in a graphical format.
A quick Google search gives this FOSS option:
Umbrello UML Modeller
EDIT: Just realized that's linux-only, so here's the Wikipedia page for a whole bunch of other options.

Which would you prefer for a function's input? Flex's DisplayObject or Flex's BitmapData? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I am in this situation where I need to select a Flex type (image placeholder/image type/image container) for passing parameters in/out of different functions in an image editor. And, those different functions are either another image-manipulation/processing function or a function that display/render the image in a display component.
For example, I will ask other teammates to create a function that processes an image (possibly piped from other image processing functions, too), (let it be fancy or basic image processing from changing colors, to scaling, to segmentation, etc.).
Which of the two would you pick for passing in/out different functions? Display Object or bitmapData, and why (reusability, performance, standard practice, etc.)?
I always use the lowest level object I can get away with, so I'd probably go with BitmapData, unless there are compelling reasons to do otherwise. This has the advantage that you can then reuse the code in Flash if you need to.
BitmapData. What would be the motivation for passing a DisplayObject ? You have to look at the functionality provided by the two classes and decide based on your tasks which one is appropriate.

Are these three articles on The DAO Pattern still relevant in ADO.NET for .NET 3.5 and .NET 4? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I found three related articles on using the DAO pattern with ADO.NET (they're a bit dated, but they seem to make good points about the nature of ADO.NET as of VS2005).
If you were a developer using VS2010 would the points in these articles still hold up?
Part One
Part Two
Part Three
(P.S. I'm a Java developer who recently was picked up for a C#/ASP.NET position)
ADO.NET still work in all version of .NET
For some uses it might be just faster and easier to start with LINQ to SQL or the Entity Framework
I would ignore five year old articles as a general rule. Think how much the industry has changed in the past five years.
I would use Entity Framework instead, and skip right over straight ADO.NET and LINQ to SQL.

Resources