Let's say I wanted similar functionality to a doubly linked list but needed a matrix instead so that each node was structured like this:
public class Node
{
Node Up, Down, Left, Right;
object Value;
}
Is there a name for such a structure? I've looked through this Wikipedia listing of data structures but didn't see anything sim...
Once in a while you stumble over a technical article where "creating" and "declaring" are used synonymously.
E.g.
declares an array of ints
creates an array of ints
But aren't declaring and creating two different things? Or does it depend on the context?
...
I am looking for good books and articles on user-interface testing.
What they should contain (one or more of):
different test methods/strategies
examples, use cases
naming pros and cons for different methods
testing functionality
testing usability (less important for my me but still good)
something important I might have forgotten :-)
...
Hi, this is a question for the algorithms gurus out there :-)
Let S be a set of intervals of the natural numbers that might overlap and b a box size. Assume that for each interval, the range is strictly less than b.
I want to find the minimum set of intervals of size b (let's call it M) so all the intervals in S are contained in the in...
Hello guys,
For a school project, we'll have to implement a ranking system. However, we figured that a dumb rank average would suck: something that one user ranked 5 stars would have a better average that something 188 users ranked 4 stars, and that's just stupid.
So I'm wondering if any of you have an example algorithm of "smart" rank...
What is a Windows scripting language that: does not rely on .NET and offers the most OOP support and has simplest deployment?
It doesn't necessarily need to be a scripting language; It can be in the form of a compiled executable, however it needs to be self contained--only ONE file, no DLL's and it cannot be declared to "include" other ...
I have encountered this topic lately and couldn't understand why they are needed.
Can you explain why I should use them in my projects and how they can ease my life.
Examples will be great, and where from I can learn this topic little more.
...
Programs like page defrag by sysinternals or the chkdsk utility that run on startup. Please enlighten me. What kind of programming language do they use for these kinds of operations.
...
Hi, following the text book, I do measure performance whenever I try optimizing my code. Sometimes, however, the performance gain is rather small and I can't decisively decide whether I should implement that optimization.
For example, when a fix shortens an average response time of 100ms to 90ms under some conditions, should I impleme...
Is it possible to compute the number of different elements in an array in linear time and constant space? Let us say it's an array of long integers, and you can not allocate an array of length sizeof(long).
P.S. Not homework, just curious. I've got a book that sort of implies that it is possible.
...
There are a lot of sites out there that have online fantasy applications. There is also a lot of design that goes into making one of these sites. Does anyone know of a good tutorial or book that covers the basics and gives readers suggestions on how to handle major design patterns.
As I work through trying to make one of these apps ...
Horribly worded question...I know.
I'm working on an application that processes data for the previous day. The problem is that I know the customer is going to eventually ask to it for every hour or some other arbitrary time interval. I know that languages such as Java or SQL have masks for defining dates. Well what about a way to def...
hello
I am working on a simple combinatorics part, and found that I need to recover position of two bits given position of other two bits in 4-bits srring.
for example, (0,1) maps to (2,3), (0,2) to (1,3), etc. for a total of six combinations.
My solution is to test bits using four nested ternary operators:
ab is a four bit string, wi...
Consider a situation in which you need to call successive routines and stop as soon as one returns a value that could be evaluated as positive (true, object, 1, str(1)).
It's very tempting to do this:
if (fruit = getOrange())
elseif (fruit = getApple())
elseif (fruit = getMango())
else fruit = new Banana();
return fruit;
I like it,...
I recently had an interview question that went something like this:
Given a large string (haystack), find a substring (needle)?
I was a little stumped to come up with a decent solution.
What is the best way to approach this that doesn't have a poor time complexity?
...
I have a collection of items (big rationals) that I'll be processing. In each case, processing will consist of removing the smallest item in the collection, doing some work, and then adding 0-2 new items (which will always be larger than the removed item). The collection will be initialised with one item, and work will continue until it ...
In the context of functional programming which is the correct term to use: persistent or immutable? When I Google "immutable data structures" I get a Wikipedia link to an article on "Persistent data structure" which even goes on to say:
such data structures are effectively
immutable
Which further confuses things for me. Do functi...
Lets say I want to make few classes to determine behaviour of agents.
The good practice would be to make some common interface for them, such interface (simplified) could look like this:
interface IModel
{
void UpdateBehaviour();
}
All , or at least most, of such model would have some parameters, but parameters from one model mig...
Hello everyone :)
I was reading http://stackoverflow.com/questions/2512504/tdd-how-to-start-really-thinking-tdd and I noticed many of the answers indicate that tests + application should take less time than just writing the application. In my experience, this is not true. My problem though is that some 90% of the code I write has a TON ...
//
// To Throw
void PrintType(object obj)
{
if(obj == null)
{
throw new ArgumentNullException("obj")
}
Console.WriteLine(obj.GetType().Name);
}
//
// Not to Throw
void PrintType(object obj)
{
if(obj != null)
{
Console.WriteLine(obj.GetType().Name);
}
}
What principle to keep?
Personal...