Last week I was out of station, it was a remote area without any cellular network or internet connection. Thus couldn't do much work. To compensate for week 10, I am gonna spend some extra hours in this current week.
With deployment on side, I started working on another parallel task, just as I did conversion percentage. This time I choose public/private model functionality. I created a dropdown in template named modelMeta
that listed three viewing options. Those were Public, only me and only followers. Now I need to insert them to database in collection ModelFiles
. I created a attribute named audience
and inserted the value. It seemed so easy doing all these. After messing with merging and deploying all other tasks seemed so easy.
Also after doing this, I started tackling small issues like adding an edit page for working on uploaded model, fixing the owner image in model viewer. It didn't show up. Now it does ;) I had to add an if condition to show default image if user hasn't uploaded any image.
I still had some time, and tried to ssh into freebsd server, but to my surprise again the same thing happened. I couldn't ssh into it. Remembered that yesterday while I was working my window server console froze. And I had to force shutdown. Instead of rebuilding again, I thought of doing some research regarding the issue. I saw the logs and came to know that cpu usage had topped 400% while I was working yesterday. I even restarted the ssh service through web console, but I still couldn't ssh into it. Nor could I ping from server.
Today I was looking into BRL-CAD mails to see if I missed any new mail. I saw that I haven't replied to sean for his reply on my approach.
Replied to his mail, tried the way he suggested me using search command. I was still getting somewhat similar error. Inder suggested to concentrate on deployment as high priority.
So I started working on deployment, I had already installed meteor successfully. Now all I need was to clone OGV and run it. It sure seemed simple. But when I cloned OGV and ran meteor command, I got list of errors that showed version conflict between mongoDb and packages. I searched online and there was a way to remove all packages and then add them without mentioning their version number. But it didn't worked for me. Did meteor reset, did meteor rebuild and even reinstalled mongodb and meteor but I was still getting the same error.
First motive today was to complete the conversion progress bar. I started looking for ways I had to take a value from server to client. I thought of doing session variable, but by it I won't be able to use the value of conversion percentage anytime after conversion of model. Another way was to tinker with Meteor.settings object, but even that seemed unstable approach. Most of the stack overflow links suggested that only using collection is a right way to share value from server to client.
It made sense, and I added conversion attribute to ModelFiles collection and update it to the conversionPercentage variable.
Retrieved that variable from client side and returned it to template helper that provides value to progress bar. It worked like a charm. I had to initialize conversionPercentage to 0, before conversion to stop getting null values in start of conversion.
After this I looked back into my server, and thought of decreasing the version of FreeBSD and try installing the meteor. Well to my surprise meteor was successfully installed in freeBSD 10.1. Thus two successful events in one day. I could get a good night sleep :P
Today I saw the GSoC timeline. And came to know that only few days left, I should start working on something else in parallel to merging and deploying.
I checked up my proposal and thought of doing conversion progress bar, as it seemed important. Now at this moment I have to see server console to make sure the model is converted. And if I press submit button before conversion I get no model. Users won't have access to server console, so it might create problem.
There's already a variable used in server side to calculate conversion percentage, my task was to take that variable value and use it somehow to show a conversion progress bar on client side.
I was in mood of tweaking front-end, so I designed a progress bar as mentioned in my proposal. Instead of save button in model description form, I had added a progress bar of same width and height. After 70% (optimum conversion percentage) the progress bar disappears and save button appears at same place. Thus we can continue only when conversion is complete.
Now only thing left was to take value of variable from server and return to template helper that is currently returning dummy value.
I commited the code and went to sleep.
Internet was working this morning. Commited the code I have written to merge obj files, and send the mail to BRL-CAD mailing list.
Got few replies from Sean, a bit heavy replies I must say. I need to learn a lot more in order to understand what I was actually doing. His mail was concerned about the way I was handling regions. I was using regex, thus being dependent on the way regions are named. This is not constant for each model. Thus that created the problem I was seeing in my console. He told me about search command of mged and it's parameter to use to get the similar results.
Also I got to know about brlman command, man command for BRL-CAD mged commands, it was extremely useful for beginners like me.
But he still was confused about the approach I am using and it seemed it isn't the right way to merge objects. Even I wasn't completely confident about that.
So I started reading about the terms CSG and mged commands to get more confident about what I am doing. Instead of hurrying up on a solution I need to learn more about these things
I faced some errors yesterday working on merging. A bit tricky errors I must say. I haven't seen anything like it before.
I tried to search, but I wasn't sure which part to search to get a valid solution. Thought of asking in mailing list. But in midday my internet stopped working and my mail didn't reach the mailing list.
While the internet was off, I started working on my posts collections. Created a schema to collection. Added the id of post, owner and the time posted.
I also added insert statements to posts collection everytime a model is uploaded or shared.
Now all I was left to do was to code the retrieval of posts which include searching the ModelFiles collection and SharedModels collection with id from Posts collection and then returning valid data pointers
Today I started to work on merging instead of deploying. Took a quick look where I had left earlier.
I had came across a method that somehow merges the parts of model using r command. I was left to execute this in OGV. Even execution steps were almost coded and all was left to make them happen in desired sequence.
I started searching about a technique to execute functions synchronously in javascript. Couldn't get what I wanted. There was a lot of talk regarding this in stack overflow. I got confused instead :P. Then I started reading the existing code and came to know we are already using a function callback for synchronous effect (function() { //stuff to execute })();
. I used the same callback in my function and well everything seemed to work.
I started dancing with joy and excited to see the merged model that came on my screen. Happiness was short lived. I uploaded another model and there came errors like rain drops. Thus came to know that for model axis.g everything works fine, but for any other model like ktank.g I get errors.
Waking up, my first thoughts were that meteor isn't installed on freeBSD this time.
Started searching about the error that occured on generating dev bundle. Some of them were about npm packages that are depreciated. Some were about version mismatch. Couldn't find any valid solution on searching. I even manually installed latest versions of depreciated npm packages. But no luck
The repository from where I was cloning meteor, wasn't a official one. There is no official repository. There are a lot of unofficial repositories to work with. I switched to another meteor unofficial meteor for freeBSD repository.
This repository also failed to work. I was completely frustrated. Thought to do something else for a break.
Took a look into my todo and came to know that shared posts are not shown in tune with posted models. Created a separate collection Posts that contains the id of posted models and shared models with their time, thus we can show all the posts in time sorted manner by retrieving from this collection
Today I came back to my workplace after 5 days. Starting where I left, I went to my freeBSD server to deploy OGV.
I tried several times to ssh into server, but I couldn't do so. Everytime I did, I got message connection timed out. I checked the server on digital ocean, it showed status ok, everything should be working as per status on digitalocean.com. I searched about it and came to know about a read only console of my server that I can access in my browser. I opened that console and tried ping goo.gl
to see if internet is working fine on server. But it showed Unkown host. Thus no internet connection on server.
I started searching about fixing the network problem. Most of the links suggested to rebuild the droplet if all else fails. I have spent a lot time searching about this problem today, and I was already running short on time. So I did rebuild my server to freeBSD 10.2
Starting from scratch once again. I started installing packages required to install meteor on server.
Sometimes things just doesn't go the way you want them to. I have already did the installation twice till now and everything worked like charm. But today, when I execute the script generate-dev-bundle.sh
I got errors. Phew! it was already late night, and couldn't hold my sleep anymore. So will see the errors tommorrow.