Saturday, September 21, 2013

GSoC Experiences(4)

All is well that ends well!
This is the only statement I can express in this last article for the series of articles under GSoC experiences.

I have been able to write a stable Javascript code which is fully functional, and has the basic functionality implemented.

For testing the new code on the grounds, I have ported the script of the PyDy Example Three link pendulum according to the new code.

I still need to write some tutorials on how to use the code, and I will post the relevant links to them, and if possible a simple tutorial on using the code here only.

Anyways I am leaving here a youtube link on the working Animation:
http://www.youtube.com/watch?v=W6MIwXUw7jQ&feature=youtu.be

And here are some screenshots for those who dont like waiting for buffering :)
It feels so exciting to see this work!






GSoC Experiences(3)

This is the third article in the series of articles written on my GSoC experiences, describing some details  on project developments, which I couldn't report due to circumstances.

I will start where I left off. So, I was working on a GUI.
This is what I came up with!



Well Its just a basic GUI with some simple implementation features, i.e. play pause and controls reset.
But it was a good start, and seemed neat.

So after that I had to start working on Javascript class, Canvas class, which was going to handle all the visualization things.
I felt that I did not have enought knowledge on Javascript structure based on Prototypes, So I spent some time knowing about prototypes, and  how to work with them.

I was stuck in more than one places during Javascript source code development phases.
I was stuck with rendering the initial scene, the axes and the grid, and getting them altogether.

Another problem I encountered was with the dreaded "this" keyword in Javascripts.
The problem was that the "Play","Pause" buttons had there OnClick attrubute attached to this.startAnimation, where "this" represented the Canvas class, But the buttons seemed to take this as the default window property of the browser, and gave errors. It took me some time to figure it out and debug them all. What works is instead of using "this.startAnimation", I was supposed to use "Canvas.prototype.startAnimation", hence this is one of the places where prototypes were savior.

Except this, there were some other minor glitches with animations, But thankfully, they were all resolved, and In next and last article of this series of GSoC Experiences, I am going to write about the final outcome of the hardwork, a working example of PyDyViz.



Friday, September 20, 2013

GSoC Experiences(2)

Continuing with my GSoC experiences, this is the second article in the list.

API seemed to be in good shape, I was supposed to start writing tests for javascripts.
The main problem which occured to me was how.
I had spent a few days figuring out exactly what I am supposed to write tests for defining the behaviour of code which will be used in animations, most of which is going to work in runtime(when we are using browser for animations).

I had some discussion with my mentor. He had given me some good motivation as well as ideas on test-writing. But (yes, call me a dumb), I cant still figure out how to do that. I had written some tests myself,
during this time, but I wasn't exactly satisfied with it.

So to keep up with time, I had to switch to writing source code for javascripts.
I was thinking that once I am complete with the source code, I should be more comfortable in writing tests for the same, once it is in working condition.

So with that in mind, I had started writing source code for the Javascripts side.
First thing that crept in my mind before starting was to give a GUI to the project.





GSoC Experiences(1)


Hi All,
I have been unable to contact for a long time. This was mainly because I had ran into some troubles while working on Javascript side, and things were not going smooth. I had to work a lot for getting all in place. I totally apologise for missing all the weekly blog entries, which I should have made.

As a cover up, I am going to share my experiences during that time, for which I missed blog entries,
In the form of GSoC Experiences articles.

So, I was able to finish with the python side by 12th August( a little late then expected).
We had a basic server built in, using WebSockets for transferring content from python to browser.
It was running smooth, and all the tests were passing.

It was decided that we would be using Jasmine for testing javascripts. I had started fleshing out a clean and detailed API on Javascripts side, as well familiarizing with Jasmine and how to write tests on Jasmine.

So we had some API fleshed out, and next I was supposed to write tests for Javascript side.