|
hi
I m developing a desktop application in streaming media using C#.
I m doing different opertions in it using multithreading like User Login, searching information from Database, searching and playing video file etc.
I m also capturing Live video from Webcam and displaying it on the window of my application. But the problem is that when I put the code of Live video capturing and preveiwing in Thread,it doesn't work i.e it doest not caputer n display the live video.
so tell me that is multithreading not possible in streaming media or there is some techniques of multithreading for it?
Plz reply me ASAP
Regards
B!z
|
|
|
|
|
its possible, but you have to ensure threadsafety, say, by using a circular buffer or similiar.
Hope this helps, Good luck
|
|
|
|
|
I'm coding a program like this in .Net 3.0. When you load a XML data. Its elements, texts, attributes will be populated on the Tree View and its full content in Text Box. I used XDocument(System.Xml.Linq) to make it faster. But now When I select a node from the Tree View, I want to highlight the line of XML code in the Text Box which contain that node. Any solution for this ? Help me, pls. Thank you.
modified on Friday, May 16, 2008 2:01 AM
|
|
|
|
|
Personally I would make a class that inherits from TreeNode and store the corresponding XML Code in it. When you select this TreeNode you can search in the Textbox for that string an highlight it.
Hope this helps
Tiefe Brunnen muss man graben wenn man klares Wasser will,
tiefe Wasser sind nicht still.
|
|
|
|
|
Thanks for your help. I thought about it and I found one problem. If two element has the exact name, attribute and text. How can I distinguish between them. I don't know how to store and retrieve their full path. Can you make an example for me
|
|
|
|
|
If two elements have the same name, you can distinguish it by the order of the elements. Have these elements the same parent?
I could only give you an example with the standard XmlDocument object. With linq i didn't handle that problem yet.
Tryout the XmlNotepad from MS, may this gives you an idea, how you can handle the Xml.
Der Staat mit der niedrigsten Geburtenrate ist nicht die Bundesrepublik, sondern der Vatikan.
|
|
|
|
|
Thank you, I will give it a shot
|
|
|
|
|
Hi Guys. Is there any other function or method I can use to return a 16 digit number? I have very large numbers that I am trying to calculate and the problem is that I am usi8ng LONG and Int64 at the moment and I only get a 13 digit value returned instead of the full 16 digits.
Does anybody have any ideas or advice?
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
I don't think anything is built in, but the libraries do exist, I am sure
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 mate. I have read a few articles but can't make head or heels from them. Have been looking ata few on Codeproject like this one http://www.codeproject.com/KB/cs/biginteger.aspx[^] but they don't seem to be much help though. Have googled around and can't find anything. Old languages like Oracle and Cobol can handle this, why not C#?
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
Perhaps people had more money back then ? :P
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 )
|
|
|
|
|
Heck, Java has a BigInteger type built in. Came in handy when I was doing some RSA stuff for my internship.
Cheers,
Vikram.
The hands that help are holier than the lips that pray.
|
|
|
|
|
Yeah, I'm sure they did. Well, lets put it this way,I have a file generated on our DEC, in COBOL which then calculates a range of numbers to create a HASH total. Problem is that the file generated only caters for 12 digits in the layout and we can't get this changed as it is a regulatory file layout. I need to recalculate this hash total so I can verify it with the third party that process the file. So, I'm a bit stuck. I have tried to calculate this in Excel 2007 but Excel 2007 seems to be doing some sort of automatic rounding for some strange reason which left me with trying to develop something in C# to do this instead.
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
A long/Int64 can handle at least 18 digits.
An alternative would be to use the Decimal data type. That will give you at least 28 digits.
Despite everything, the person most likely to be fooling you next is yourself.
modified on Friday, May 16, 2008 2:29 AM
|
|
|
|
|
Hi,
the long/int64 type in C# can hold 18-digit numbers
since 10^18 = 1000^6 =almost= 1024^6 = 2^60; or 63*0.301 = 18.9 where 0.301=log10(2)
if your code does not perform as expected, something is wrong.
You may want to publish both the relevant parts of the code, and the exact symptoms.
|
|
|
|
|
Hi Luc. I think I may have found the problem. I shold have gone back to the route of where it could have stemmed from which is at the import stage. I was importing them as Int32's. I changed that now and it seems to be working. I just need to check this to see if I get the same total as what the app is getting now.
How do I get this to run faster. It seems to take a good 2 minutes to import and calculate 3500 records. Below the full code listing.
FileHelperEngine<imphash> engine = new FileHelperEngine<imphash>();
engine.ErrorManager.ErrorMode = ErrorMode.SaveAndContinue;
imphash[] res = engine.ReadFile(filepath);
if (engine.ErrorManager.ErrorCount > 0)
engine.ErrorManager.SaveErrors("Errors.txt");
foreach (imphash hsh in res)
{
txtboxdisplay.Text += hsh.Field1 + Environment.NewLine;
}
long sum = 0;
foreach (imphash hsm in res)
{
sum += Convert.ToInt64(hsm.Field1.ToString());
}
txtboxdsptxt.Text = (sum.ToString() + Environment.NewLine);
}
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
I found that writing the data to a text box was what was the delay and not the calculation.
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
And now you are using a string variable and append to it with += ?
Then you'll find that it's still very slow when you get to large strings (because the whole string needs to be copied for each concatenation).
You should use a StringBuilder instead.
|
|
|
|
|
Hi Kwagga,
your code is doing several things: getting data, outputting it to a textbox,
summing it. If this takes too long, first thing you should do is find out which
part is responsible, typically by either inserting accurate timing code, or
by disabling some of the parts.
My best guess is the display part is the culprit.
For one thing, you are creating N different strings (N=3500), where each new
string is built with +=, hence needs to copy all the previous content.
And you are telling the txtboxdisplay to update itself N times.
If line wrapping is irrelevant (I guess it is), I strongly recommend you replace
the textbox by a ListBox; a ListBox is very good at displaying a large number of
independent lines of text, it never needs them to be concatenated, and it updates
very fast since it only processes a change, as in ListBox.Items.Add(string) .
|
|
|
|
|
Yeah, I found that it was the displaying of the items. I have cut that bit out of the code cause I don't really require it. It now takes a split second to process 100 000 records.
Thanks again.
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
decimal theNum = 12345678901234567890;
ulong theNum2 = 12345678901234567890;
MessageBox.Show(theNum.ToString() + " - " + theNum2.ToString());
-= Reelix =-
|
|
|
|
|
You could use the decimal type.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Thanks mate. I have figured out what the problems was. I was importing the data as Int32 and after changing that to long it worked fine.
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
hello frnds,
can i pass optional parameter to C#.NET method like VB.NET ???
if yes then how ???
is there any another option to get it ?
thankx in advance
koolprasad2003
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
No, you cannot. You have to create a chain of methods with less parameters that call the longer methods with the default
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 )
|
|
|
|