Posts

Showing posts from June, 2013

Doing some SVG drawings on a web page (Raphael.js)

So for this tree based problem that i am currently trying to solve, one of the first perquisites was to get better at Recursion , the next thing to work out was, how do I draw shapes and lines on an HTML page? So prior to this my only experience with drawing on an HTML page was this simple badly presented snake game that i had created using the canvas. Anyway for this little project i decided to look around for some libraries that would allow me to draw some shapes and I found a couple of libraries such as Raphel.js and D3.js that would let me draw SVG shapes on a web page. After very briefly investigating them, it seemed that Raphaeljs would be a better fit for my problem and hence i began my SVG drawing journey with Raphael. Now when i think about this problem, i can think of it as a sequential list of little sub-problems that i need to individually solve before i can build my great grand tree drawing solution. This is a slightly larger problem and hence it will be spread ou...

Fun with Recursion: back to basics.

I am currently working on solving a problem that is about trees, lots and lots of them. Looking at this problem, the first thing I realised was that, while I can solve this problem using stacks, this is really a problem for which a recursive solution is a natural fit. Recursive problem solving is something that I have quite lost the hang of in recent years, using only iteration on a day to day basis. Hence I decided to go about rectifying it and learning what is essentially early uni years stuff. This is harder than it sounds, not because of the problem itself but because of how "dumb" I felt, given that this is really something that I should be naturally good at. Now once I got over my emotional issues and hours of self loathing, I actually had a strategy of how I can get better at recursion. The strategy was simple, forget about my work experience, the education, the scientific publications etc etc, all in all swallow my pride and start from...