|
Why it is said that Finalizers are performance costly. I heard that classes which have finalize method will be kept in a separate finalization queue by GC ? Is this making the performance problem ? Or any other reasons ?
|
|
|
|
|
|
They says it's costly, but why ? They have not given any convenient reason. I checked the same in plenty of sites, but no one gave a convincing reason.
|
|
|
|
|
Yes... as u said Classes with finalize method will be kept in Finalization queue which is performance overhead coz the Runtime checks the heap memory if there is any Object is out of scope, if the runtime find such which has finalize method then the Object is moved to Finalizing queue in that particular runtime cycle. So the Runtime on its next preceding cycle checks if there any Object is not referenced, if nothing found then it checks Finalizing queue and founds the Object there and clears the queue. So Objects with finalize method required two runtime cycles to get cleared obviously causing performance overhead. So instead u can use Dispose method. But in some cases u need to have Finalize method if the Object is referenced and dereferenced more frequently.
|
|
|
|
|
|
i am developing C#.NET application and i am facing a problem in converting website HTML page to XML format using C#.NET
|
|
|
|
|
|
If you simply want to parse it you could look at the SGML reader which is a managed C# library for reading the SMGL standard (i.e. old non-xml compliant html). I think it also has an option to export to xhtml strict.
|
|
|
|
|
|
|
Is there any easier/other way to deep copy a List<anyclass> other than serialize to memorystream and then deserialize into a new object?
The List comes from a method on a remoting server in singleton mode and fills a combobox on a UI. So i guess filling it directly with the ref would be bad practice.
If it' stuck, DO NOT pull harder!
|
|
|
|
|
Take a look at the Clone method.
|
|
|
|
|
List<t> does not interace iCloneable so i would have to
<br />
Foreach(someclass myobject in mylist){<br />
newlist.add(myobject.clone());<br />
}<br />
And the class of the list needs to interface ICloneable
am i right?
If it' stuck, DO NOT pull harder!
|
|
|
|
|
Yes, you will need to create a copy of the list yourself. While, List<T> does not implement ICloneable, ArrayList does. But even so, it's only a swallow copy.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
Hello, I'm new here and I've got a problem. I am working on my school project and it entails using a pda as an infrared remote control for TV's / hi-fi systems. I've gone through some of the previous posts here and they helped a little. But the problem now is that while i'm able to connect to the COM2 port and use it as serial communication with the System.IO.Ports namespace, my program keeps freezing when i try to perform a Read(byte[], offset, length) operation. Now i am not even sure if the Write() operation is actually working, however it doesn't freeze my system. Can anyone show me what to do? I need to learn the infrared codes from the remote control and then retransmit them when i need them. please any help is appreciated as time is running out for me. thanks
Emotu
|
|
|
|
|
Have you tried this[^]? It should give you a good example to work from and help you debug your issue.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
thanks a lot for the help Tom. however, i'm trying to control the IR port on a windows mobile, read infrared signals from a remote control and store them before retransmission. If you have something close to this, I'd be extremely grateful.
Take care,
Emotu
|
|
|
|
|
this is my code
<asp:templatefield headertext="FileName">
<itemtemplate>
<asp:hyperlink id="HyperLink1" runat="server" target="_blank" navigateurl="~\Feedback\+<%#Eval(QAFilename)%> +">
<%#Eval("QAFilename") %>
i want one of my column in gridview with hyperlink value so i used the above snippet in my code the actual functionality i want is when i click on the hyperlink button i want that particular file to be opened, so in the navigate url attribute i used "'~\Feedback\ + <%#Eval(QAFilename)%> +'" upto feedback path is is fixed i want to add the filename dynamically but it is not working cananybody suggest me
regards
sunil
|
|
|
|
|
Give a DataNavigateUrlFields="File_id" into the Your HiperlinkField
|
|
|
|
|
the code snippet which i have posted was deleted in my Question
sorry i think i was not clear enough actually i am manually giving path as NavigateUrl='~\Feedback\ after the slash i have to give the name of the file in navigateurl attribute iwant to know how to concatenate my file names after the last slash which are in my gridview
anyway thanks for posting ur answer plz do get me better answer if possible
regards
Sunil
|
|
|
|
|
Why you have put the same question in different board (both in C# and also ASP.NET ).
|
|
|
|
|
actually my proj is asp.net with c#.net coding so i put my question in both anyway i got the solution i used anchor tag in place of hyperlink
|
|
|
|
|
|
i get this error when i attemp to use
SqlBulkCopy.WriteToServer(DSet.Tables[TableName]);
Yogesh Pekhale
pekhaleyogesh@gmail.com
|
|
|
|
|
pekhaleyogesh wrote: SqlBulkCopy.WriteToServer(DSet.Tables[TableName]);
There is a DateTime value out of range bug somewhere inside there, fix the bug there.
Sorry, if you can only give brief description of the problem, we can only give brief answer/suggestion.
|
|
|
|