I tried reading previous posts about NP-
My question is what does the word "COMPLETE" mean?
Why is it there?
What is its significance?
N- Non-deterministic - makes sense'
P- Polynomial - makes sense
but the "COMPLETE" is still a mystery for me.
I tried to implement XOR sort in python.
x,y= 10,20
x,y,x = x^y,x^y,x^y
print('%s , %s'%(x,y))
OUTPUT:
30 , 30
I am not new to python but I am unable to explain this output. It should have been 20,10.
What is going on under the hood?
Diagram.net is good diagramming tool.
I need to understand what design patterns are used by this tool so that I can understand how it works.
What design patterns are used in this tool?
What design patterns are generally used for diagramming tools?
I would also like to know how can I use this to develop very simple diagramming tool (Only rectangular nodes and straight links).
NOTE/Caution: I am doing this for FUN so please don't direct me to existing tools(I might down vote.. just kiddin ;).
Diagram.net is good diagramming tool.
I need to understand what design patterns are used by this tool so that I can understand how it works.
What design patterns are used in this tool?
What design patterns are generally used for diagramming tools?
EDIT:
Diagram:
http://www.cs.umass.edu/~immerman/complexity_theory.html
There must be some meaning to the word "complete" its used every now and then.
Look at the diagram.
I tried reading previous posts about NP-
My question is what does the word "COMPLETE" mean?
Why is it there?
What is its significance?
N- Non-deterministic - makes sense'
P- Polynomial - makes sense
but the "COMPLETE" is still a mystery for me.
There is function in python called eval that takes string input and evaluates it.
>>> x = 1
>>> print eval('x+1')
2
>>> print eval('12 + 32')
44
>>>
What is Haskell equivalent of eval function?
My colleague keeps telling me of the things listed in comments.
I am confused.
Can somebody please demystify these things for me?
class Bar
{
private int _a;
public int A
{
get { return _a; }
set { _a = value; }
}
private Foo _objfoo;
public Foo OFoo
{
get { return _objfoo; }
set { _objfoo = value; }
}
public Bar(int a, Foo foo)
{
// this is a bad idea
A = a;
OFoo = foo;
}
// MYTHS
private void Method()
{
this.A //1 -
this._a //2 - use this when inside the class e.g. if(this._a == 2)
A //3 - use this outside the class e.g. barObj.A
_a //4 -
// Not using this.xxx creates threading issues.
}
}
class Foo
{
// implementation
}
class Node
{
FooType Data; // I can save Data to file with extension .foo
void Save()
{
// save Data to .foo file
}
}
Now ,
class Graph
{
List<Node> Nodes;
void Save()
{
foreach(Node node in Nodes)
{
node.Save();
}
}
}
Now when I invoke someGraph.Save(); then it creates Nodes.Count number of files.
I would like to appear those files as one file with extension somename.graph and be able to read it again as Nodes.
How can I do this? Is there a way to bundle files into a single different file?
class Foo
{
public int A { get; set; }
}
class Program
{
static void Main(string[] args)
{
var f = new Foo();
var ff = f;
Console.WriteLine(f.GetHashCode());
Console.WriteLine(ff.GetHashCode());
FooFoo(ref f);
BarBar(f);
}
private static void BarBar(Foo f)
{
Console.WriteLine(f.GetHashCode());
}
private static void FooFoo(ref Foo f)
{
Console.WriteLine(f.GetHashCode());
}
}
OUTPUT:
58225482
58225482
58225482
58225482
What is the difference between FooFoo and BarBar?
class Foo
{
Bar b;
List<Foo> Neighbours;
}
class Bar
{
Spam s;
List<Bar> Neighbours;
}
class Spam
{
List<string> Neighbours;
}
Each of these classes have AddNeighbour,RemoveNeighbour methods.
User can add/remove Neighbours from any of the class at random.
I want these three objects to be in sync.
How can I do this?
In python zip function accepts arbitrary number of lists and zips them together.
>>> l1 = [1,2,3]
>>> l2 = [5,6,7]
>>> l3 = [7,4,8]
>>> zip(l1,l2,l3)
[(1, 5, 7), (2, 6, 4), (3, 7, 8)]
>>>
How can I zip together multiple lists in haskell?
class Node
{
string name;
Node previous;
};
Error: Node::previous uses "Node" which is being defined.
How can I get this to work in C++? It works in C#.
EDIT:
Why Node* previous works?