|
|
Firstly,
When posting code use either the <code></code> for inline code, or the <pre></pre> tags for code blocks (like yours).
so
public class Person
{
private List FFamily;
public string Name
{
get { return FName; }
set { FName = value; }
}
public Person()
{
FFamily = new List();
}
//public static Comparison AgeComparison =
// delegate(Person P1, Person P2)
// {
// return P1.Age.CompareTo(P2.Age);
// };
//public static Comparison NameComparison =
// delegate(Person P1, Person P2)
// {
// return P1.Name.CompareTo(P2.Name);
// };
}
becomes
public class Person
{
private List FFamily;
public string Name
{
get { return FName; }
set { FName = value; }
}
public Person()
{
FFamily = new List();
}
}
abosch2000 wrote: Do i not need to concern myself with the collection of these items? List does not need to implement "IDisposable" to be managed by the GC?
For the most part in .NET, you don't need to implement the destructor or IDisposable, unless there are specific reasons for doing this (e.g. a connection of some sort must be closed, or disposal of child objects needs to take place ion a particular order etc).
You also rarely have to worry about garbage collection. Garbage collection is handled by the .NET framework automatically, any objects that are orphaned are disposed for you periodically. The method the framework uses to determine orphaned objects is quite complicated, but basically it boils down to (as I understand it), if an object is inaccessible from the call stack and is not in an object graph that is accessibile from a call stack, then it is considered orphaned. In the case of list items that have been cleared, the items themselves are orphaned as they no longer appear in the list's tree of objects (presuming there are no other references to the cleared items in other objects). This also happens when a class instance goes out of scope and is not referenced elsewhere.
The disadvantage of the .net framework's implicit collection mechanism is that you don't know exactly when it will happen, just that it happens periodically. In scenerios where memory is a a premium (e.g large numbers of, or very large, objects in the object graph) you might want an explicit Garbage Collection, but more often than not the automatic collection is fine.
Hope this helps.
CCC solved so far: 2 (including a Hard One!)
|
|
|
|
|
can anyone help me by providing "COX" algorithm
modified on Friday, September 25, 2009 11:31 AM
|
|
|
|
|
Not like this. Please remove the caps, I may reconsider helping you.
|
|
|
|
|
Ok, this page[^] might be of interest to you
I don't know much more than that page already says though
|
|
|
|
|
That was just silly.
Everything makes sense in someone's mind
|
|
|
|
|
Yea I know
|
|
|
|
|
No worries.
I use a few different forums, and here on CodeProject ppls seems to be more anal about style and format
than other places.
One common response you see here alot is, "Did you Google it???". I'm thinking, either Yes they did Google it
and were led here, or No they didn't and don't wanna spend alot of time search through Google results. This is
an answer forum and when you ask a question you're hoping for a direct answer. Know what I mean?
Everything makes sense in someone's mind
|
|
|
|
|
I see your point, but unlike other forums, the majority of users here want to improve the abilities of the people who ask the questions (Providing they are willing to learn). Nobody is going to get better if all they have to do is ask somebody else for the answer then go and copy/paste the code.
People who are not willing to attempt something themselves are people who quite frankly shouldn't even consider being programmers. Too many people think it's easy money and thus cause problems for the whole industry.
It gets very annoying when a question appears where the first result of a google search for their subject line provides all the information they could possibly need. That's how you know when you have a lazy unwilling 'Programmer' and they're the type who need to be shot down (not literally).
I actually spend a fair bit of time on here trying to help people, and am more than happy to help someone who is struggling with a new concept but has actually tried to do it for themselves first.
Anyway, that's my opinion, and I am sure it's not to everyone's liking, but who would complain? A willing learner? I think not
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Ya, I agree with you. Too many people want the quick & easy and not have to work for it.
Everything makes sense in someone's mind
|
|
|
|
|
Yea I know, but the experience has been that they really haven't googled it and that giving the first link from google makes them say "omg thanks man!"
Which is just a waste of everyone's time really..
And then there is also Liquid Nitrogen[^]
|
|
|
|
|
Agreed
Everything makes sense in someone's mind
|
|
|
|
|
And also LMGTFY which is both helpful and annoying!
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
|
|
|
|
|
KMAROIS wrote: I use a few different forums, and here on CodeProject ppls seems to be more anal about style and format
than other places.
True, but it even says in the FAQs/Stickies to place code in the relevant tags, otherwise most people won't even bother to read it.
KMAROIS wrote: One common response you see here alot is, "Did you Google it???". I'm thinking, either Yes they did Google it
and were led here, or No they didn't and don't wanna spend alot of time search through Google results. This is
an answer forum and when you ask a question you're hoping for a direct answer. Know what I mean?
From some of the posts, it is pretty obvious the OP hasn't even been bothered to Google it (in whcih case why should we? Or, often, they just want a peice of code they can copy and paste (in which case I want commision ).
Generally I want to help people improve their knowledge, but poor posts take up time and effort to read, and put people off helping.
CCC solved so far: 2 (including a Hard One!)
|
|
|
|
|
Have you tried here[^]
only two letters away from being an asset
|
|
|
|
|
Giving you the answer is not going to help you in the long run. Have you attempted anything yourself, do you even know what a 'COX' algorithm is? I don't by the way, so don't expect an answer from me
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
i just want d working ........of cox algorithm and how it can be used to encrypt file and perform compression
|
|
|
|
|
From what I know about it, it doesn't do either. It's for steganography.
|
|
|
|
|
FIRST!
how can i setup my SQL server 2008 data base in computer that does not have SQL server?
|
|
|
|
|
REPLY!
Install SQL Server!
CCC solved so far: 2 (including a Hard One!)
|
|
|
|
|
i make a setup file that include the date base and my program,so how can i make the setup file works?
|
|
|
|
|
You need to install SQL Server to deploy the database to.
You could install SQL Server 2008 Compact, but I'm not sure what the licensing is.
CCC solved so far: 2 (including a Hard One!)
|
|
|
|
|
Try here[^]
only two letters away from being an asset
|
|
|
|
|
|
I am using a richText box to display (output) messages to the users of my application. The box fills up from top down. When messages accumulate they do not get pushed up. Here is some of my code.
<pre><code>private void btnPowerOn_Click(object sender, EventArgs e)
{
// init equipment set current limits etc
richTextBox1.Focus();
richTextBox1.Text = richTextBox1.Text + "Initializing Equipment.. \n";
InitEquipment(); // initialize Equipment
richTextBox1.Focus();
richTextBox1.Text = richTextBox1.Text + "Turning Power Supply and Current Source on.. \n";
TE.PowerSupply.TurnOutputOn(strPowerSupplyName);
TE.CurrentSource.TurnOutputOn(strCurrentSourceName);
// checking to find which UUT's are enabled
WhichUUTChecked();
}</code></pre>
The richTextBox gets called a few times. The richTextBox1.Focus() command does not seem to work they way I expect it.
Any hints appreciated.
Sophronis Mantoles<pre></pre>
|
|
|
|