|
George_George wrote: For "static storage space for generic types" for different parameter types of a generics type will share different storage?
To "share different storage" sounds like a contradiction...
The types Foo<Bar1> and Foo<Bar2> are separate types, so they will each have threir own set of static variables. All instances of the Foo<Bar1> class will share the same set of static variables.
George_George wrote: Are there any documents beyond this article of this topic?
You always have the language specification:
ECMA C# and Common Language Infrastructure Standards[^]
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Great Guffa!
I have read parts of the documents before for the interested parts. But the total part is too big.
Any ideas about which part of this documents covers different reference type parameter for a generics type will share different static storage in this document?
regards,
George
|
|
|
|
|
Hi All,
My requirement is to call a function for creating data in one system.Each function calls will create one user credentials in the system and for this i'm calling this function inside a "for" loop.And after the call returns im showing the result for each input in a datagrid.but this is consuming lot of time.
Coming to the point i want this to be executed using Threading.But i'm still a amateur in threading concept.I want the main thread to wait till all the worker threads completes it job and then execute the part where the result is shown.
The code snippet is like this
for(int i=0;i<noofusers;i++){>
userResult=callFunction(userDetails); //the function which i need to be called using threads
datagrid.source=userResult; //i want the for loop to continue but this binding should not happen until the current worker thread returns the result.
datagrid.bind();
} //i want the main thread not to go out of this loop until all worker thread returns or completes
private Result callFunction(){
......//here the user will be created in the system...
return result;
}
Please help me in this issue.
--
Thanks and Regards
KC
|
|
|
|
|
Threading doesn't work for a web app, it's a disconnected system. The user is not going to see anything until all the code runs.
AJAX is the way to do seperate calls so that your web Ui shows before all the calls have completed.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi Graus,
I dont want the user see the result in datagrid untill all the data is inserted into the system.So that part of threading where the user can proceed working on the page while the thread is running in the background is not needed. My need is to save time by inserting multiple users into the sytem at almost the same time by the method of threading.And in Asp.net c# webapplication we have the option to do threading. But my problem is implementing my concept and thereby achieving the purpose.
You can see a similar method used in this page
http://www.c-sharpcorner.com/UploadFile/tinlam/MultithreadedWebApplications11172005002508AM/MultithreadedWebApplications.aspx[]
Please help me in this issue.
Thanks and Regards
KC
|
|
|
|
|
I can only reiterate - when your main page thread ends, your page will postback. Therefore, multi threading will not help your page speed, unless you have more than one machine to share the work . The one processor still needs to do it all, multi threaded or not. Yes, you can run multiple threads, it will NOT make your page faster, how can it ?
If you think otherwise, work the code from that article to do what yuo want, and see if it speeds things up.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi,I am a student and i am new to issues regarding certificates and signing in .net.... In .net i created an application and iv used click once to sign my assembly..i have used a test certificate here and i have kept that in the trusted publisher list...and then i go to the publish tab and i go to http://localhost/mysite/publish.html..when i press install here it would raise a popup stating this is from a trusted publisher.. but when i use it from some other system.. and then say http://199.75.12.44/mysite/publish.html then it would pop up a security message stating unauthorized publisher... How can i avoid this pop up? Thanks and regards ananth
|
|
|
|
|
To *really* have your code authorised, you need to use a trusted certificate, not one you generate yourself. This costs money.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks Graus... but if i buy a code signing cerificate from vendor like verisign how does the authentication process take place? I have tried the OpenSSL also through which i create a certificate and associate it with my code but then with this also i get an error... could u please suggest some related links.. i googled around for wuite some time but dint get the required thing.... majorly the concern is regarding the popup that comes when i access through some other system..
|
|
|
|
|
Basically, IE is going to trust a verisign signed certificate, but it's not going to trust one you created yourself, unless it comes from the local machine.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks graus...
sorry for the trouble.. if i have to work only on the intranet and then is the test certificate sufficient?? consider i develop this application and try to acces it form another pc which is in the intranet and is not connected to the internet.. then even if i buy a verisign certificate will it be verified? Thanks once again..
|
|
|
|
|
If you're able to get everyone using it to mark your site as trusted, that will be fine.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi all,
I have a form that have assign OnClosing event (CancelEventHandler) . My question is how can i break the event and get back to application after i press the close button "X"(beside the maximize button)?I have use "return" to try to get back my application, but it dosen't work for me. Below is the example coding..
this.Closing += new System.ComponentModel.CancelEventHandler(OnClosing);<br />
<br />
<br />
private void OnClosing(object sender, System.ComponentModel.CancelEventArgs e)<br />
{<br />
exitToolStripMenuItem1_Click(sender, e);<br />
}<br />
<br />
<br />
private void exitToolStripMenuItem1_Click(object sender, EventArgs e)<br />
{<br />
DialogResult dResult = DialogResult.None;<br />
dResult = MessageBox.Show("Save Changes to New Project before Exit?", "Exit TimewayGenerator", MessageBoxButtons.YesNoCancel);<br />
<br />
if (dResult == DialogResult.None || dResult == DialogResult.Cancel)<br />
{<br />
return;<br />
}<br />
}<br />
Any tips are welcome.
Thanks in advance.
regards
cocoonwls
|
|
|
|
|
cocoonwls wrote: CancelEventArgs
The cancel event args has a flag passed in you can set, to stop the app closing
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
In addition to what CG said, you should handle the condition in your OnClosing event handler itself. Why are you explicitly calling another event handler? If they do exactly the same work, consider creating another method and calling it from your two event handlers.
Cheers,
Vikram.
The hands that help are holier than the lips that pray.
|
|
|
|
|
Agreed - the second method is downcasting the event, for a start. The menu item should just close the form, and the closing event should handle asking if the form should be closed or not
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
"The menu item should just close the form, and the closing event should handle asking if the form should be closed or not"
I have done what you said, it work for me. thanks
|
|
|
|
|
Vikram A Punathambekar wrote: Why are you explicitly calling another event handler?
That's a pet peeve of mine - I've seen code go to extraordinary lengths to call another event handler directly.
|
|
|
|
|
Hey, Senthil, it's been a while. How are you doing, and where are you now? Is your phone number still the same?
Cheers,
Vikram.
The hands that help are holier than the lips that pray.
|
|
|
|
|
I'm going great, how about you?
I flew back to Chennai a couple of weeks back. And yes, my number is still the same.
|
|
|
|
|
To cancel the event just simply set
<br />
e.Cancel = true;<br />
in OnClosing function.
Anindya Chatterjee
|
|
|
|
|
Hi,
How to get goto functionality in richtextbox...
richtextbox.Find(NextLine, LineNo, RichTextBoxFinds.WholeWord) takes lot of time....any faster way to highlight the line or just get cursor on that line
Regards
KAMALESH
%#&kmpYrlHSGYG5@#($_+!@!(*JASnjshdk,cm_0ashjhdbn@#$!48mkhfbchsh))^%#W%&@YW7wsdfjw789';'][]\`~JKJQ4$!@#~)-HSKS^&*1)JK12@#@$~!1`DFGkqp][]\]?Zas;EWRG%!@~)(^&BVAG
|
|
|
|
|
Hi Kamlesh,
Please try the following code snippet and see if this helps. The following code shows how to use one of the overloaded versions of Find.
-------------------------------------------------------------------------
BEGIN CODE
public int FindMyText(string searchText, int searchStart, int searchEnd)
{
// Initialize the return value to false by default.
int returnValue = -1;
// Ensure that a search string and a valid starting point are specified.
if (searchText.Length > 0 && searchStart >= 0)
{
// Ensure that a valid ending value is provided.
if (searchEnd > searchStart || searchEnd == -1)
{
// Obtain the location of the search string in richTextBox1.
int indexToText = richTextBox1.Find(searchText, searchStart, searchEnd, RichTextBoxFinds.MatchCase);
// Determine whether the text was found in richTextBox1.
if(indexToText >= 0)
{
// Return the index to the specified search text.
returnValue = indexToText;
}
}
}
return returnValue;
}
-------------------------------------------------------------------------
END CODE
Hope this helps.
Regards,
John Adams
ComponentOne LLC
|
|
|
|
|
Hello everyone!
I am writing a desktop share application that takes screen shots of the screen and sends it to a remote host, where the host can click on the picture and take control of the other person's computer, so to speak.
Everything is working just fine, except I keep failing out after a few minutes due to an OutOfMemory exception. I do not understand why this is happening, as I am monitoring the memory levels of the computers and they seem to be completely fine.
Is there another reason why this error would occur? I am receiving the pictures in a while (true) loop, and at the bottom I always .Dispose of things I no longer am using, and I always make a call to the GC (garbage collector) class so I can free up some memory. This, however, is to no avail.
Any thoughts are appreciated!
-Karl
|
|
|
|
|
KarlWF wrote: and I always make a call to the GC (garbage collector) class
This should not be necessary. But, it seems you are leaking resources somewhere. Perhaps if you posted some code ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|