|
|
Cryptographic hashing or the hashing used in hashmaps and dictionaries?
|
|
|
|
|
Or the hash in waccy baccy.
Regards
David R
---------------------------------------------------------------
"Every program eventually becomes rococo, and then rubble." - Alan Perlis
|
|
|
|
|
|
"Data Structures and Algorithms in Java (Michael T. Goodrich and Roberto Tamassia)" explains it in some detail. But it's a huge book with only half a chapter about hashing, and the examples are in Java. I'd just google around a bit, there's plenty on the 'net about hashing
|
|
|
|
|
Hey
i have another question regarding showing Picutres in matlab. Well I took one pic of 2*2 size and selected some part of that picture. Now I need to show that selected part of 2*2 size.
how to do that ?
can anyone help me in this??
suchita
suchitamanandhar@hotmail.com
|
|
|
|
|
Hey ,
I have some problem using Matlab Masking function. Actually i have to imfreehand to draw the freehand image. I calculated the pixel of the freehand by the command getposition.
imshow('mypic.tif');
h = imfreehand();
s=getPosition(h);
Now I need to make use Mask and make the pixel of the freehand image as 1 and the rest as 0. Does anyone have any idea how to solve this?
Thanks in advance
suchita
suchitamanandhar@hotmail.com
|
|
|
|
|
|
Hi,
this is not a pass-me-the-code site, this is a serious site with programmers helping programmers. There are some recommendations in the "How to get an answer to your question" message, you might benefit from reading it carefully.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
You're too kind.
You measure democracy by the freedom it gives its dissidents, not the freedom it gives its assimilated conformists.
|
|
|
|
|
I need an algorithm to check if two dates(startdate,enddate) are overlapping with another twodates(startdata,enddate)
can any one help or atleast give me the way of thinking of it becuase i need ot apply this on .NET and on
SQL
Thanks and Best Regards
|
|
|
|
|
first = the one that has the minimum start date
second = the other one
overlapping = first's end date >= second's start date (maybe you want > instead of >=)
Of course input must be valid (start date <= end date).
Eslam Afifi
|
|
|
|
|
Ok i got your point since the both intervals should have start data end date
and since these intervals should be valid intervals( startdate< enddate)
the only cond i should check is if the first interval's end date is before the second interval start date
and vise verse.
thanks
|
|
|
|
|
khalil.kamel wrote: the only cond i should check is if the first interval's end date is before the second interval start date
and vise verse.
Why vice versa!
After sorting these are the possible output
---first----------
---second----
---first----------
---second----
---first----------
---second----
All are covered by only one check (first's end >= second's start).
Eslam Afifi
|
|
|
|
|
It can also be that
-----------first-----------
---------second-----------
Just to be complete. So I think it is another small check, but in total not difficult.
Cheers
You have the thought that modern physics just relay on assumptions, that somehow depends on a smile of a cat, which isn’t there.( Albert Einstein)
|
|
|
|
|
It can also appear that the second starts first, but still overlaps the first. Or not overlapping the first.
So I would check both not just first end and second start.
Just to be complete.
Cheers
You have the thought that modern physics just relay on assumptions, that somehow depends on a smile of a cat, which isn’t there.( Albert Einstein)
|
|
|
|
|
Thank you for your reply.
Eslam Afifi wrote: first = the one that has the minimum start date
second = the other one
Eslam Afifi wrote: After sorting these are the possible output
In that case, the second becomes the first before applying the overlapping check. Or did I misunderstood your message?
Eslam Afifi
|
|
|
|
|
first define "first"
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
|
Yes sorry had a bad time yesterday. Simply overhead this stuff.
Can happen.
Cheers
You have the thought that modern physics just relay on assumptions, that somehow depends on a smile of a cat, which isn’t there.( Albert Einstein)
|
|
|
|
|
No problem. It happens all the time. Have a great day
Eslam Afifi
|
|
|
|
|
Thanks
You too.
Cheers
You have the thought that modern physics just relay on assumptions, that somehow depends on a smile of a cat, which isn’t there.( Albert Einstein)
|
|
|
|
|
Why do you even need an algorithm for this?
If you have the pairs (A,B) and (C,D) (assuming the enddate is always after the startdate - if not just swap them)
return (A > C && A < D) || C < B;
works because:
two cases are handled:
1) A is after C, they only overlap if A is also before D otherwise (A,B) is completely after (C,D)
2) A is before C, they only overlap if C is somewhere before B otherwise (C,D) is completely after (A,B)
disclaimer: it was 2 AM when I wrote this, it could easily be complete crap. Sorry!
|
|
|
|
|
will am asking this question becuase i need to take care of my performance issue. taking into concideration
that there are many date intervals i should check and your code ( my old code ) is not good at that scenario regardin performance
|
|
|
|
|
I severely doubt there is a faster way. If, however, you are checking overlap on many dates at once (which I suspect you are, because you are having a performance issue with it), there is a better algorithm than a naive "O(n*n) tests" algorithm. I don't remember it now, but I'm quite sure it exists..
|
|
|
|