|
Soooooo 5-ed.
//L
|
|
|
|
|
|
code sent please i give up to try
that in main topic i added code
|
|
|
|
|
You have reposted instead of adding to the original thread.
I suggest you google for the breadth-first algorithm for this problem, if that is the one you want. Then work out how to implement it in C#. This is a well known problem, there is plenty of material on the Internet.
In your first post you didn't give any code, let us know what is wrong or ask what you needed. You need to do all of this before you'll get a reasonable answer. The other thing is, people here won't do your homework / employed work for you, but it looks like you are asking for this, even if that is not what you meant.
Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter.
Pete o'Hanlon: If it wasn't insulting tools, I'd say you were dumber than a bag of spanners.
|
|
|
|
|
I thought it meant "completion" -- gimme the whole thing.
|
|
|
|
|
I didn't find any question here.
Looks like you posted your test paper answers for your friends.
|
|
|
|
|
i will explain simply
make a program to solve 4 queen problem that by using two classes
Bfs class that contains breadth first search
and Node class contains Best node to choose
take that my work in section
http://www.mediafire.com/?zkzhlenykj3[^]
picture explain
http://www.mediafire.com/?txky0xkdngq[^]
class Node
{
public bool[,] state { set; get; }
public Node parent { set; get; }
public List<Node> childs { get; set; }
public int level { get; set; }
public int Hfunction()
{
int res=0;
return res;
}
public void generate_child()
{
for (int i = 0; i < 4; i++)
{
bool[,] newstate = (bool[,])this.state.Clone();
Node child = new Node();
childs.Add(child);
child.parent = this;
child.level = this.level + 1;
newstate[child.level, i] = true;
child.state = newstate;
}
}
public bool visited { get; set; }
public Node GetBestChild()
{
int Min = int.MaxValue;
int min_index = -1;
Node BestChild = null;
for (int i = 0; i < 4;i++ )
{
int CurrentValue = this.childs[i].Hfunction();
if (CurrentValue < Min && this.childs[i].visited == false)
{
BestChild = this.childs[min_index];
BestChild.visited = true;
Min = CurrentValue;
min_index = i;
}
}
return BestChild;
}
}
class BFS
{
public Node BfsProcess(Node root)
{
Node soultion = null;
if (root.Hfunction() == 4)
{
return root;
}
else {
root.generate_child();
Node bestchild =null;
while ((bestchild = root.GetBestChild()) != null)
{
soultion = BfsProcess(bestchild);
}
return soultion;
}
}
}
you can find nice solve but must use bfs
i find smart project like http://www.mediafire.com/?txky0xkdngq[^]
but i need to do simple project 4x4 board
|
|
|
|
|
I have a server class that should be able to dynamically load classes that implement IServerExtension from a dll. Our current concept works and looks like this:
Project [ServerExtensionInterface]
interface IServer { /*several important methods that do server stuff*/ }
interface IServerExtension { Init(IServer srv); /*init will be called from the server after creating an instance*/ }
Project [Server]: Reference to [ServerExtensionInterface]
class Server : IServer
{
/*Implements the curious Methods of IServer*/
List<iserverextension> Extensions = new List<iserverextension>
void LoadExtFromDll(string filename) { /*open dll assembly, create class instance and call newext.Init(this);*/ }
}
Project [TestExtension]: Reference to [ServerExtensionInterface]
class TestExtension : IServerExtension
{
IServer Server;
TestExtension() { /*make some extension-internal setup stuff*/ }
Init(IServer srv) { this.Server = srv; /*some additional stuff for communicating with the server*/ }
/* some other things that do cool stuff */
}
---
This all does work well, however, there are these two things that bug me a bit:
Server.ExtensionList ---[reference]--> Extension
Extension.Server ---[reference]--> Server
I'm not sure if this bi-directional association is any good. It could end up in infinite loops or something.
Also, when compiling, the output is as follows:
Server Project: Server.exe, ServerExtensionInterface.dll
TestExt Project: TestExtension.dll, ServerExtensionInterface.dll
The identical interface dll file. I don't like having that additional dll. It is created because the ServerInterfaceExtension project that is referenced to, needs to be compiled to have the IServer and IServerExtension types available in the extensions and the server. Since it is a independent project after all, these types compile into their own dll.
It is not an option to entirely remove the ServerExtensionInterface project and supply the actual Server and Extension projects directly with the files that define the interface. This will lead to type incompatibility. The IServer and IServerExtension in Server.exe may be different from those in TestExtension.dll, thus methods (such as Init(IServer srv) can not be invoked.
Question:
I'd like to know whether there is a general misconception in my interface ideas or something, maybe someone has experience with such things?
|
|
|
|
|
Hi all,
I am using
<input id = "files" type = "file" runat = "server"/>
for a user to upload a file, this file will have contents similar to:
Morgan,Freeman,morgan@domain.co.za,0743700187,1987/12/31
Morgan,Obama,obama@statehouse.com,0743720187,2010/12/31
I then want to separate these fields accordingly and assign them... like,
first.Text = "Morgan";
last.Text = "Freeman";
email.Text = "morgan@domain.co.za";
these values should be retrieved from the file remember,
Does anyone know how I can do this or approach to take.
Please help
Thanks,
Morg
|
|
|
|
|
|
Thanks man that was so helpful
|
|
|
|
|
Try this:
string[] lines = File.ReadAllLines(path);
foreach (string s in lines)
{
string[] fragments = s.Split(',');
...
}
You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy
|
|
|
|
|
Hi OG,
Thanks alot,
you code works quiet ok but I have another issue, look at my code below:
HttpPostedFile myFile = files.PostedFile;
string strFilename = Path.GetFileName(myFile.FileName);
string[] lines = File.ReadAllLines(strFilename);
foreach (string s in lines)
{
string[] fragments = s.Split(',');
errors.Text = fragments[0];
errors.Visible = true;
}
remember the contents of my file look like:
Kiss,Simwaba,morgan@domain.co.za,0743720187,1987/12/31
Person,Simwaba,morgan@domain.co.za,0743720187,1987/12/31
what happens is that when i pick
errors.Text = fragments[0]; it
returns "Person" which is the first index[0] in the second line.
I don't quiet know why it ignores the first line....
Please help me in case am making a mistake somewhere.
Morg
|
|
|
|
|
Hi,
I am working .net 3.5 version.
I am developing windows application.
I need to add reference the mscorlib dll from the microsoft reference ,
but i cannot able to do that instead of i got this error as follows,
"A reference to 'mscorlib' could not be added' this component is automatically added by the project system and cannot be referenced directly".
So how to resolve this problem..
Can u please explain me...
Thanks & regards,
kannak......
kannak
|
|
|
|
|
sekannak wrote: I need to add reference the mscorlib dll
why is that??
I never felt a need to add it, as it is always present. It is the core of .NET (you could check with Reflector).
|
|
|
|
|
sekannak wrote: instead of i got this error as follows,
"A reference to 'mscorlib' could not be added' this component is automatically added by the project system and cannot be referenced directly".
Just like the error says, it's self explanatory.
Besides, why do you want to reference it? tell me exactly what you want
to do with thi dll,
Morg
|
|
|
|
|
Well huh? If it is not present, that means you explicitly checked that one checkbox in the advanced build settings that says "Do not reference mscorlib.dll" - just uncheck that
|
|
|
|
|
|
That function is not provided by .NET.
But even if it were, mscorlib.dll is referenced already unless you checked said checkbox.
(and btw, it's not like I'd give you any help after you were so nice as to give me a 1-vote)
|
|
|
|
|
Ok I've had it - 2 downvotes without explanation on a completely legitimate post?
No more help from me for at least a year.
|
|
|
|
|
Hi,
I need to use password Encryption file, the file is below
unix_md5_crypt
Fot that i came to know, to include the the reference , am not sure.
Can u please explain ...
kannak
|
|
|
|
|
You don't need to add a reference to mscorlib. All you do is import the System.Cryptography namespace and the classes will be available to you without having to specify the entire namespace path to it.
DId you also realize that MD5 is considered to be broken by the entire industry? It's easily cracked now.
|
|
|
|
|
|
sekannak wrote: I need to add reference the mscorlib dll
No you don't.
Core.dll, maybe, but not mscorlib dll.
|
|
|
|
|
hi,
i have a datagrid control with some data.nw i want to add a separate column containing spin control(up-down) control.how can i do that?
|
|
|
|