15,890,825 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Yossi Yaari (Top 13 by date)
Yossi Yaari
10-Mar-13 11:42am
View
I do agree with you in principal.
Yossi Yaari
10-Mar-13 11:40am
View
:-)
thanks
Yossi Yaari
5-Mar-13 14:21pm
View
that is of course correct in general.
and here the mathematical solution is very light weight. so I'm not sure how much it will improve performance. as you your self commented.
Yossi Yaari
5-Mar-13 14:19pm
View
I think I fixed. thanks for the comment
Yossi Yaari
5-Mar-13 0:53am
View
the best reason I think to do so is to minimize chance for error.
if the rectangles don't intersect - their not close enough. so very small chance for significant false positive answer on collision, if there is an error in the calculation.
Yossi Yaari
5-Mar-13 0:50am
View
OK
Yossi Yaari
5-Mar-13 0:49am
View
that would have very slow performance.
O(n) instead of O(1)
Yossi Yaari
5-Mar-13 0:48am
View
what I mean is that you could add a method that accepts object of Type <t> and calculates the key by itself using the binding method. so that in theory, if the binding changed, you could leave the code the same.
MyClass a;
var data = new MemberBindingDictionary<myclass>(x => x.Name);
data.Add(a);
if(data.ContainsKey(a)) //<-- would stay true for any change of ^^^ binding method
{
...
}
Yossi Yaari
4-Mar-13 14:20pm
View
sounds like a really forced question :-)
Yossi Yaari
4-Mar-13 13:40pm
View
that's definitely the direction I was thinking.
just was wondering how bad the implementation would turn out. mostly in terms of performance.
and of course you could add a ContainsByKey using the same binding func. :-)
Yossi Yaari
4-Mar-13 13:21pm
View
you meant IntersectsWith(...) of course
Yossi Yaari
4-Mar-13 13:13pm
View
I think he means circles or 2D balls.
in any case your solution for calculating distance between centers is correct.
I wonder if it is worth testting Rectangle.Intersect in advance?
Yossi Yaari
4-Mar-13 12:34pm
View
still not clear what kind of database solution your looking for
Show More