In that case, you shouldn't be parallelising the code at this point. This
concern was raised specifically for the case where you have a parallel
architecture that has to be throttled because of a singleton.
Not sure what you are referring to.
I took your response to suggest that you were addressing the Singleton Pattern, and not one specific instance of that.
Pete O'Hanlon wrote:
So, we're talking about introducing a method just to get through a test; not for
any other purpose.
That way, if you discover that you want to manage disparate contacts across several data sources and therefore it shouldn't be a singleton any more, it's much easier to change. It means that if you want a temporary separate instance for some reason (e.g. importing external data), you can do so.
I have an 'in.xml' file which I would like to 'collapse' into an 'out.xml' file in c#. (Not necessarily asking for the code but the approach to do this ie. xslt or xmldocument add attributes) Many thanks in advance.
The files are as follows:
I disagree. I feel his post was the most usefull of all, instructing you to increase your skillset. This would have the effect of you being able to solve this particular problem in a far more efficient method than posting a question in a discussion forum.
Your code is using Console output so it will only go to a file handle, stdout, or whatever that is redirected to. If you want it to go to your form or memory stream then you need to change your code to use a streamwriter[^].
Programming is work, it isn't finger painting.Luc Pattyn
I got an industrial camera device and want to generate a stream which could be shown by the windows mediaplayer activeX control on an other device in the same network.
It's just for monitoring the images made by the camera on a HMI of our mashine.
Do you got any hints for me, how i could realize this?
I think i just need some starting information. ^^
like "use System.IO.Stream and do ..."
not a whole solution ...
I got the Images every time a hardware trigger occurs. The camera framework provides methodes to save it as png to disk. But I want to broadcast it directly to a stream on which the HMI can connect or just show.
It's just an idea:
If you already have a png-file you could use an internet browser as client to view the image.
I would create a simple html file containig the image with automatic reload tag for the page.
You could access the html-file via file sharing or you implement a little http-server. The HttpListener[^] might help you.
It is not the way you wanted (Mediaplayer...) but I think it's a solution according to your requirements
i'm not sure about the possibilities in the HMI Designer software to integrate a html side.
to view the html file, i need a browser, right?
or a built in control in the HMI software, which shows html files....
Standard video formats run at quite a high framerate. Are you recording images that fast? If so it should be possible to stream an AVI with a bit of file format jiggery-pokery, though I'm not aware of Framework methods that make this straightforward.
Alternatively, if you're in charge of both ends, you could write a trivial application that accepts streamed PNGs and updates a PictureBox. The bandwidth on this would be fairly high but assuming it's for intranet use and for only a few endpoints, that should be okay.
The point P1 is at the end of a line, the line has the angle At1. The point P2 is at the beginning of a line with the angle At2. I know the coordinates for P1 and P2. I also know the angles At1 and At2. A radius is formed between P1 and P2 and I need to know the center point Pc for the (invisible) circle the which is formed with P1, P2, At1 and At2. The points P1 and P2 can be anywhere in the coordiante system.
I know it's not c# specific, however I was hoping to come across someone who's solved this.