|
Hi,
1.
thank you for the code. It is unreadable, lacking PRE tags which would have preserved formatting. Also the start is missing i.e. how is the string input in this?
2.
you did not react on my simple suggestion to try a short word with repeat characters ("aha").
3.
your Node is carrying too much data, most of which is redundant, and hence a small mistake somewhere will make nodes inconsistent, and the algorithm very hard to debug.
4.
NextCousion never gets initialized?
5.
layers(current.parant.NextCousion); is the biggest suspect. If I understand anything of your code, it seems to move sideways in the family tree, but downwards on the stack. That is a very bad idea, especially as I don't see a sideway limiting factor.
6.
there is just too much code for the simple job at hand. less code typically is easier to understand, and easier to debug (although it probably needs it less, since it typically also contains fewer bugs to start with).
7.
suggestion: throw it all out the window; rethink the matter and start afresh.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
its working with "NOON" , "TORONTO" . but when its "STATISTICS" it throws exp
|
|
|
|
|
hotthoughtguy wrote: its not infinite recursion
Then why are you exhausting the stack??
From what I could see in your code, not that it's very readable to start with, you're creating new child nodes, then INFINITELY, digging into those nodes and creating new ones.
Luc is right - scrap this and rethink what you're doing. You're going through a lot to do very little.
|
|
|
|
|
Hi everybody!
Hi have a problem when read dates from a strored procedure:
CREATE PROCEDURE
Articulos_GetByCodigo
(
@ParametroEntrada nvarchar(7)
)
AS
SET NOCOUNT ON
SELECT Gestion
FROM msTablaGestion
WHERE msTablaGestion.Codigo = @ParametroEntrada
SET QUOTED_IDENTIFIER OFF
GO
I call the method from a external method in the same class like this:
ExecuteStoreProcedure("Articulos_GetByCodigo", numeroPL);
articuloPermitido = reader.GetBoolean(0);
this is my method:
public void ExecuteStoreProcedure(string nombreProcedimiento,string parametro)
{
using (SqlConnection connection = new SqlConnection(cadenaConexion))
{
using (SqlCommand command = new SqlCommand(nombreProcedimiento,connection))
{
connection.Open();
//command.Connection = connection;
command.CommandType = System.Data.CommandType.StoredProcedure;
command.CommandText = nombreProcedimiento;
command.CommandTimeout = 10;
command.Parameters.AddWithValue("@parametroEntrada", parametro);
reader = command.ExecuteReader();
}
}
}
I receive in the call this : Metadata attempt invalid when the reader is closed
I think should be because i call the method and later the reader is closed, any have some sugestion.
P.D. I write the method outside because i want use this in another calls with another paremetres.
Thanks in advance
|
|
|
|
|
I believe the problem is that you are calling the reader outside of the scope of the readers command/connection objects. So inside of your method try this.
public void ExecuteStoreProcedure(string nombreProcedimiento,string parametro)
{
using (SqlConnection connection = new SqlConnection(cadenaConexion))
{
using (SqlCommand command = new SqlCommand(nombreProcedimiento,connection))
{
connection.Open();
command.CommandType = System.Data.CommandType.StoredProcedure;
command.CommandText = nombreProcedimiento;
command.CommandTimeout = 10;
command.Parameters.AddWithValue("@parametroEntrada", parametro);
reader = command.ExecuteReader();
while (reader.Read())
{
articuloPermitido = reader.GetBoolean(0);
}
}
}
}
Or you could have the method return the bool value from the reader.
|
|
|
|
|
Thanks Ian,
yes, i was thinking also this. My problem is that i wanted reuse the method for example for make another call like this
// This is the first one:
ExecuteStoreProcedure("Articulos_GetByCodigo", numeroPL);
articuloPermitido = Convert.ToBoolean(respuesta);
ExecuteStoreProcedure("Refrigerador_GetByIdTabla", numeroId);
if (IDTablaConservacion == 65)
articuloRefrigerador = true;
Where the sp Refrigerador_GetByIdTabla makes this query :
"Select IDTablaConservacion FROM Articulos where (IDTablaConservacion = '65' AND IDConservacion = '1') AND CodigoArticulo ='" + numeroId + "'";
Thanks and regards.
|
|
|
|
|
can somebody provide me the source code for student information system......it would be of gr8 help to me...
|
|
|
|
|
There is a very good student information system: Google.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
i tried searching for it but couldnt find one it would be gr8 if u can post the link....
|
|
|
|
|
Student Information System
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
|
Very good observation, you catch on quick. Now if only we could link you <-> google....
|
|
|
|
|
The University of Utrecht offers one, I think.
Not sure where, exactly. You could try to contact them.
UU[^] (site in English, of course)
|
|
|
|
|
I'm feeling generous today so here you go...
public class Student
{
public Student(Information information)
{
Information = information;
}
public Information Information
{
get;
set;
}
}
public class Information
{
}
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Filofax.
Edit: It doesn't matter how many times you try to one-vote. I don't care. Just know that to do so without posting a comment is cowardly. If you think you have an opinion of my posts, then share it
|
|
|
|
|
I using access database for some application.
I update some values in the access - and i getting the information from the same table in same thread - and i see that the values are not right and not update correctly. How can i know if the data was update already ?
Is there some option to get some event when the table in the database done update ?
|
|
|
|
|
How to a Control to the NonClient area of Form in C#?
Fly Like An Eagle With MIGHTY POWER.
|
|
|
|
|
Define "control". What is it you want to do with the NC area??
|
|
|
|
|
Control means like Button,RadioButton ,CheckBox,Slider Control,Numeric updown and etc...
Fly Like An Eagle With MIGHTY POWER.
|
|
|
|
|
Your explanation doesn't clear things up. Are you saying that you want to put those controls in the TitleBar of a window??
|
|
|
|
|
How to develop chat application without server for LAN,
in articles I saw application only whith server-part and client-part
I want leart, how develop chat application (multiuser) whithot server
Thanks
upyachka watches you
|
|
|
|
|
|
Hi,
I need to convert the richtext box contents into csv format and then write it into a file.
Currently I am reading the richtextbox contents(text), line by line in a for loop and then replacing the whitespace character with a separator(",") and then write it into a file using file.write() method. This process is taking a huge time.
Can anybody suggest a method which will take less time.
Thanks,
Virendra
|
|
|
|
|
You could try doing the substitution in one go. Also, posting the relevant snippet will help people find bottlenecks.
Cheers,
Vikram. Current activities:
Films: The classic Pink Panther series
TV series: Friends, season 3
Books: Liar's Poker, by Michael Lewis. Carpe Diem.
|
|
|
|
|
Does anyone know whether this is possible? I've read various articles and some which use LoadLibrary explicitly at runtime rather than using the DllImport attribute. Perhaps it's possible to use LoadLibrary16 to do the same for a 16 bit windows DLL
Matt Adamson
|
|
|
|