|
how i get the object location in image by pixel coordinate ?
|
|
|
|
|
Google for "machine vision" and you'll find out just how hard this is to implement.
You're never going to get a full explanation about how this works or how to do it in a forum environment. There's just far too much information to convey. Think entire sets of university classes.
Having said that, start with this[^] and go check out the OpenCV library[^] and Emgu[^], which is a .NET wrapper for OpenCV.
System.ItDidntWorkException: Something didn't work as expected.
-- said no compiler, ever.
C# - How to debug code[ ^].
Seriously, go read this article.
Dave Kreskowiak
|
|
|
|
|
Message Closed
modified 4-Jan-18 9:19am.
|
|
|
|
|
Strings are immutable: you cannot change a string once created. Any attempt to change it generates a new string.
So this:
string a = "hello";
string b = a;
b += " world"; Means that a and b do not contain the same string: a has "hello" and b has "hello world". All string modification operations return a new string, the old is unmodified.
That's a problem if you are generating a big string in little pieces: adding lines to a chunk of text before you write it to a file for example:
string myBook = "";
foreach(string line in myDatabaseRows)
{
myBook += line;
} This allocates a new string each time you add, so it starts to use up memory at a rapid rate of knots - and it starts to get quite slow, as each time you add a new line, you have to allocate memory for the new output, and copy the whole of the existing text into it, add the extra line, and move on. That's very inefficient!
That's where a StringBuilder comes in: It's a string which can be changed, or grown:
StringBuilder myBook = new StringBuilder();
foreach(string line in myDatabaseRows)
{
myBook.Append(line);
}
string output = myBook.ToString(); This does a lot fewer allocate-and-copy operations (it allocates an amount of space at the start and if you exceed that, it allocates twice as much and copies everything over) so it's a whole load more efficient - particularly if you can guess how much space you need and allocate that at the beginning:
StringBuilder myBook = new StringBuilder(1000000); Will give you a megabyte to start with, and if you don't exceed that it's the only allocation that is done - no "extra" copyiong is ever needed.
They are also needed if you start interop working with native code which doesn't know that strings are immutable - you hand them a StringBuilder and they can fill it in as needed. But that's the advanced stuff!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
The end reason is performance: Stringbuilder can cancatenate strings faster (for the reasons previously mentioned).
But you need to be doing a bit more than simply combining "a few"; though it can help readability of code in cerain cases.
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
Hi everybody,
I would like to update the content of a datagrid control depending on inputs from a child window.
Let's say I have a child window which consists of a dialog box requiring inputs from the user and a button "Proceed".
Once the user clicks on "Proceed" the child window is closed but the entered inputs are used to update a datagrid on the parent window.
Best regards,
RV
|
|
|
|
|
The child window should not know anything at all about its "parent" window, nor should it try to manipulate any controls on it.
The correct way to do this would be to have the child window expose it's data and events that the parent window can subscribe to. The parent window will be responsible for updating it's own controls with the new data as it sees fit.
System.ItDidntWorkException: Something didn't work as expected.
-- said no compiler, ever.
C# - How to debug code[ ^].
Seriously, go read this article.
Dave Kreskowiak
|
|
|
|
|
Another method would be to collect the data from the dialog and pass it back to the parent viewmodel when the dialog closes.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Use a shared data source: e.g. POCO / class object; (observable) collection.
Preferably supporting INotifyPropertyChanged.
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
Thank you to all of you answers.
I have found a way to do by placing the following code snippet in the child method from which I want to update a DataGrid control on the parent window:
foreach (Window window in Application.Current.Windows)
{
if (window.GetType() == typeof(AlarmResolution))
{
(window as AlarmResolution).userReportDataGrid.Items.Add(userReport);
}
}
Where AlarmResolution is the parent window and userReportDataGrid is the DataGrid control on that parent window that needs to be updated according to child treatment.
|
|
|
|
|
I was reading this article:
C# - All About Span: Exploring a New .NET Mainstay[^]
It seems that these new template classes allow for the instantiation of something that would be on new heap (and therefore at the mercy of the all-powerful system garbage collector), but instead could be done on some existing mamory, including that created on the stack - which of course would allow the programmer to have some control over when the memory is released.
Or perhaps I am way off and too far into my Samuel Adams Winter Lager sessioning to properly grok this ...
|
|
|
|
|
Well, the main idea behind Span<T> is outlined here[^]. The key section worth looking at states this:
Span<T> is a new type we are adding to the platform to represent contiguous regions of arbitrary memory, with performance characteristics on par with T[]. Its APIs are similar to the array, but unlike arrays, it can point to either managed or native memory, or to memory allocated on the stack.
For the memory class, it's worth reading the goals here[^].
This space for rent
|
|
|
|
|
Hi good day!
I just want to know about the complete code and the process of RFID system with sms notification using c# or any tutorial for me to help me out of my thesis project please....
Thank You for reading.....
|
|
|
|
|
You get to know about things by researching them, and you get the full code by writing it. If you struggle, you ask your tutor for help.
=========================================================
I'm an optoholic - my glass is always half full of vodka.
=========================================================
|
|
|
|
|
It doesn't quite work like that.
We do not do your work for you.
If you want someone to write your code, you have to pay - I suggest you go to Freelancer.com and ask there.
But be aware: you get what you pay for. Pay peanuts, get monkeys.
The idea of "development" is as the word suggests: "The systematic use of scientific and technical knowledge to meet specific objectives or requirements." BusinessDictionary.com[^]
That's not the same thing as "have a quick google and give up if I can't find exactly the right code".
So either pay someone to do it, or learn how to write it yourself. We aren't here to do it for you.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
So, a thesis is a rather lengthy and in-depth research paper, and you just came here asking other people to do your research for you. Do you think you should get a passing grade on the paper knowing that you can't explain at least part of it because you didn't do the research yourself?
System.ItDidntWorkException: Something didn't work as expected.
C# - How to debug code[ ^].
Seriously, go read these articles.
Dave Kreskowiak
|
|
|
|
|
You need to update your sig! Plurals imply multiple articles; there is but one link.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Whoops! Forgot to change that. Fixed!
System.ItDidntWorkException: Something didn't work as expected.
-- said no compiler, ever.
C# - How to debug code[ ^].
Seriously, go read this article.
Dave Kreskowiak
|
|
|
|
|
how to append message in sql server while we uploading any excel sheet data into database with more than 200 hundreds records
|
|
|
|
|
Member 13200944 wrote: append message in sql server while
What are you talking about? Append a "message" to what? And what does a limit of 200 records have to do with anything?
System.ItDidntWorkException: Something didn't work as expected.
C# - How to debug code[ ^].
Seriously, go read these articles.
Dave Kreskowiak
|
|
|
|
|
i am inserting more than 1oo rows in database through procedure through excel sheet. when we get
some records are already exist to our database in this case we have to append all the message in a output variable for showing that this records already exists.if u have some technique then please let me know.
|
|
|
|
|
This is a really bad habit to get into.
SQL servers are normally terrible at string handling. Having the SQL server do this doesn't scale well and can lead to memory allocation inefficiencies and other problems on the server.
Also, not every client is going to want this error message coming back and may, instead, just want an error number. This is because of localization and globalization. You can't change the language the message is generated in if it's generated on the SQL server side.
It would be better if you had the client just INSERT one record at a time and have the client side build up it's own error message strings in the local language based on the returned error code from your procedure.
It also reduces the amount of traffic coming back from the SQL server, which is better for mobile applications.
System.ItDidntWorkException: Something didn't work as expected.
-- said no compiler, ever.
C# - How to debug code[ ^].
Seriously, go read this article.
Dave Kreskowiak
|
|
|
|
|
how does the Data Adapter bridges the gap between the dataset and database?
|
|
|
|
|
We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.
Try it yourself, you may find it is not as difficult as you think!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|