Posts

Showing posts from November 27, 2018

Lazy property is initialized twice

Image
up vote 0 down vote favorite As we all know lazy property is not thread safe . my evaluation part is like this. if someclass isInitialized { return someclass instance } else{ initialize someclass return someclass instance } The problem is If thread 1 sees that someclass is not initialised it will then try to do so. If thread 2 sees that someclass is not initialised before thread 1 gets to do so, then it too will try to initialise it too. so it is initialized twice can we overcome this with lazy property? swift lazy-evaluation lazy-initialization share | improve this question asked Nov 21 at 7:35 Naveen

Finding radius of circle inscribed in trapezium

Image
up vote 3 down vote favorite 7 A circle is inscribed in trapezoid $ABCD$ . Let $K,L,M,N$ be the points of intersection of the circle with diagonals $AC$ and $BD$ respectively. $K$ is between $A$ and $L$ and $M$ is between $B$ and $N$ . Given that $AK*LC = 16$ and $BM*ND = frac{9}{4}$ , find the radius of the circle I was able to deduce a few elementary things $AB + CD = AD + BC$ and also tried using power of point and use the given products but didnt get anything useful geometry share | cite | improve this question edited Oct 5 at 13:01