|
Hi all,
according to what i rad about boxing and valueType allocation -
When i define some Value Type ( like struck or int ) the CLR allocate memory on the stack.
When i boxing this valueType the create reference on the heap that will point on the variable that i already define on the stack.
My question is -
allocate memory on the stack is more effective then allocate on the heap ?
What is the benefit of allocate valueType on the stack ?
Thanks.
|
|
|
|
|
|
Perhapse he was 'struck' by an int?
|
|
|
|
|
Yanshof wrote: When i define some Value Type ( like struck or int ) the CLR allocate memory on the stack.
That depends on where your value type is used. It will not always goes to stack.
Yanshof wrote: allocate memory on the stack is more effective then allocate on the heap ?
What is the benefit of allocate valueType on the stack ?
In .NET, you don't need to bother about the allocation like in C++. The run-time will take care about it. If you need to learn how memory is allocated in CLR, read this[^].
|
|
|
|
|
Dear All,
When im connecting wmi that error is coming.. how to i solve the problem.this is my coding.Any one can help me?
ConnectionOptions connection = new ConnectionOptions();
connection.EnablePrivileges = true;
ManagementScope scope = null;
domain = "abc.com";
connection.Authority = "NTLMDomain:" + domain;
connection.Username = userName;
connection.Password = password;
//Local Machine
if (compName.ToUpper() == Environment.MachineName.ToUpper())
{
scope = new ManagementScope(@"\root\cimv1", connection);
}
else //Remote Machine
{
scope = new ManagementScope(@""+ compName + @"\root\cimv1", connection);
}
try
{
scope.Options.EnablePrivileges = true;
scope.Connect();//Error User credentials cannot be used for local connections
ObjectQuery query = new ObjectQuery("SELECT * FROM Win32_OperatingSystem");
ManagementObjectSearcher objsearcher = new ManagementObjectSearcher(scope, query);
ManagementObjectCollection objcol = objsearcher.Get();
}
finally
{
}
|
|
|
|
|
Hi,
Just modified the above code and if still getting the error then might be help below solution
//Local Machine
if (compName.ToUpper() == Environment.MachineName.ToUpper())
{
scope = new ManagementScope(@"\root\cimv2");
}
else //Remote Machine
{
connection.Authority = "NTLMDomain:" + domain;
connection.Username = userName;
connection.Password = password;
scope = new ManagementScope(@""+ compName + @"\root\cimv2", connection);
}
Regards,
Anil Saran
|
|
|
|
|
I am working on a project that needs to fit square images into a rounded shape like ellipe or circle without clipping (i.e. like fish eye lens). Any one know a method in WPF to do this?
|
|
|
|
|
hi
i want programe of student database in visual studio.Net framework in c# .plz any one who could send me the code within 3 days plz its urgent.
|
|
|
|
|
What color should the database be in? I have a green and blue one I can spare.
/ravi
|
|
|
|
|
I think the blue one has better performance
|
|
|
|
|
I'd go with the green. Although the blue may have better performance it crashes too often with the blue screen of death.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
Of course it's urgent if your homework deadline is in three days. However, people on these forums don't do other peoples (home)work.
So I suggest that you start researching and coding right away and if you have specific questions and get stuck then I believe people are willing to point you into the right direction.
|
|
|
|
|
yup its a home work but our professor had taken only 2 classes in the whole semester and we cant learn c# properly and in the end of the semester he gave us project .and now i dont have time to sit and search on net (as exams are also nearer) if any one could kindly help me plz.
|
|
|
|
|
sajda wrote: yup its a home work but our professor had taken only 2 classes in the whole semester and we cant learn c# properly and in the end of the semester he gave us project .and now i dont have time to sit and search on net (as exams are also nearer) if any one could kindly help me plz.
So, you want somebody else to pass your course for you then. The technical term for this is cheating, and I'll be no part of that.
I appreciate that you say your professor didn't help out much, but you're old enough to take some responsibility for your own actions and you should have taken the time to learn this on your own - that's the way most people here did.
|
|
|
|
|
Read carefully Colin's very good answer: http://www.codeproject.com/script/Forums/View.aspx?fid=1650&msg=2875111[^]. I think it's encouraging and at the same time it shows what is expected from you.
The situation you described isn't nice but it's manageable. Try to do your best in the given time. And as I said, if you get stuck on a specific issue, describe it well and I believe that you may very well get help from extremely talented people on this site, but in the end, it's up to you.
If you really put your mind into this task, I'm sure you get the job done.
|
|
|
|
|
That is a problem with more than just your programming professor. For my intro, intermedia, and AP computer programming courses in high school, I ended up teaching the class in the end and the teacher still gave lengthy end of the semester projects. This was also duplicated for my next 2 college programming courses. It only gets worse (but alas more interesting) from here. Every once in a while you get an excellent programming teacher (I have had 2 good professors out of 5), but you still need to be prepared for the professors that may not teach the subject how they should.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
sajda wrote: i want programe of student database in visual studio.Net framework in c#
That is increadibly vague - What should this program do? How far have you got so far?
|
|
|
|
|
the programe out put shows the student names,class,father name,student ID NO,roll number it must be of 50 students .the code must be written in visual studio.Net (C#). .plz its urgent.
|
|
|
|
|
Colin is probably one of the last people on this Earth who is going to write your code for you. If you really want it written for you, I suggest going to Rent-A-Coder (http://www.rentacoder.com[^]), but, as always, you're going to pay for it to be done.
Oh! And if your caught turning in someone elses work, I hope the scholl you're going to expells you!
|
|
|
|
|
Dave Kreskowiak wrote: Colin is probably one of the last people on this Earth who is going to write your code for you
Absolutely. I'll try and correct if (if he shows any) but the only time I ever wrote code for anyone I was for a girl in my class and I wanted impress her and ultimately to go out with her. It didn't work. She eventually married my friend instead.
|
|
|
|
|
sajda wrote: the programe out put shows the student names,class,father name,student ID NO,roll number
Okay, we now know what the output is.
sajda wrote: it must be of 50 students
We now know how large this database needs to be.
However, we don't know what you want it to do. How do you expect to get the data in there? How is the information to be retrieved? Can the user manupulate the information?
sajda wrote: plz its urgent
Please, stop trying to guilt trip people into doing your homework. It doesn't work. It just irritates people.
When I was at uni' I once had a 6 week assignment that I didn't start until 36 hours before the deadline. I had to stay awake for almost all those 36 hours doing just that assignment becuase I was too lazy to do it before. Do you know what lesson I learned from that. I learned to start assignments as soon as I was given them, and I learned to that I have to do a lot of study ON MY OWN becuase my lecturer hadn't given me all the information. Guess what? In the real world you get even less information, so if you can't learn on your own you are not going to do well.
Now, I'm trying to be helpful, but you have to help me in order to help you. You have to show some initiative and show what you have tried. You have to make an attempt. And you have to be clear about what you are trying to achieve.
|
|
|
|
|
ok!thanks for ur advices the probleum is that i havent installed the software of visual studio in my home pc ok i wil tried it by my myself and for this i ihave to stay in uni till 5 0'clock.Now i will work by myself and show results to u .
|
|
|
|
|
I'll be happy to. Make the cheque out for Peter O'Hanlon - my charge is £5,000 per day and I'll even throw in aftersales support.
|
|
|
|
|
Pete O'Hanlon wrote: my charge is £5,000 per day and I'll even throw in aftersales support
Does that include or exclude VAT?
|
|
|
|
|
You are in the wrong field.
"Well, we're getting "F"'d at work. WPF, WCF, and WWF... WTF?" --John Simmons
|
|
|
|