<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mayank Lunayach on Medium]]></title>
        <description><![CDATA[Stories by Mayank Lunayach on Medium]]></description>
        <link>https://medium.com/@lunayach?source=rss-60ad26d2a968------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*kyMb3XLiaHSplFWraZl0RA.jpeg</url>
            <title>Stories by Mayank Lunayach on Medium</title>
            <link>https://medium.com/@lunayach?source=rss-60ad26d2a968------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 13:18:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@lunayach/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[A summer of code to remember!]]></title>
            <link>https://medium.com/@lunayach/a-summer-of-code-to-remember-355118890820?source=rss-60ad26d2a968------2</link>
            <guid isPermaLink="false">https://medium.com/p/355118890820</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[systers]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[gsoc]]></category>
            <dc:creator><![CDATA[Mayank Lunayach]]></dc:creator>
            <pubDate>Mon, 06 Aug 2018 13:01:08 GMT</pubDate>
            <atom:updated>2018-08-06T13:01:08.188Z</atom:updated>
            <content:encoded><![CDATA[<p>Today, final evaluations for GSoC have started. Three months ago, I started a remarkable journey that has taught me so much. I have become more confident in development than ever. I have become more punctual to deadlines than ever. And many more things, that I could never cover in a single blog.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fXf05Mp8_4_y2yUa" /></figure><p>I should admit, I was not a frequent open source contributor before GSoC started. And here I am, have almost transformed an existing Open Source project.</p><p>Those coding night outs, those 100s of comments in my initial PR’s (yes that’s true 😅), those project meetings (sometimes, even 2 Hours!), and the games that we played during team building sessions 😄. Have already started to miss it…</p><p>For the work that I did in last week, was mostly to fix new issues that were raised during the coding period. After that, I wrote documentation for the ChatBot. Here challenge was to write in a way so that even a beginner with no knowledge of ML can start experimenting with it. After that, in Systers, you have to give a final live demo of whatever work that was completed in Summer. I had to merge all my work in a single branch and prepare an attractive powerpoint presentation.</p><p>So, this could well be the last blog of my series where I used to talk about my GSoC work. Hope you enjoyed it. This is definitely not the end. I have now become more motivated to contribute to OpenSource and would share whatever new interesting I’m doing, very soon. Stay tuned!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=355118890820" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cross-Validation for evaluating ML model]]></title>
            <link>https://medium.com/@lunayach/cross-validation-for-evaluating-ml-model-a7b37becc280?source=rss-60ad26d2a968------2</link>
            <guid isPermaLink="false">https://medium.com/p/a7b37becc280</guid>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[chatbots]]></category>
            <category><![CDATA[gsoc]]></category>
            <category><![CDATA[systers]]></category>
            <dc:creator><![CDATA[Mayank Lunayach]]></dc:creator>
            <pubDate>Mon, 30 Jul 2018 13:42:02 GMT</pubDate>
            <atom:updated>2018-07-31T18:39:47.599Z</atom:updated>
            <content:encoded><![CDATA[<p>You may have been following my earlier blogs about my <strong><em>GSoC</em></strong> this year. One of my task in the timeline was to have a context-specific <strong>ChatBot</strong> capable of answering questions <em>related to Malaria</em>. We had a very small dataset to train the dialogue model. Evaluating the model by checking its predictions on a completely new dataset would have given very fewer scores. <strong>Also, this would not have been the true validation of the model given it’s not that the parameters’ are responsible for lesser accuracy<em>.</em></strong></p><p>I’ll be sharing some of the most common types of validation techniques present out there and then mention which technique <em>I chose in the end</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oBgAhPKH9FaraMQD" /></figure><h4>Holdout Method</h4><p>Here, we remove a part from the training data and get predictions over it by training over the rest of the dataset. Since there is a good chance that training data may not end up in the validation set, it would lead to the large variance.</p><h4>K-Fold Cross Validation</h4><p>Here we divide data into <strong>k </strong>parts. And repeat the above Holdout method <strong>k</strong> times. Each time, <strong>1</strong> set is used for validation and other<strong> k-1</strong> are used for training. The error is calculated by averaging errors obtained in all the validations.</p><h4>Stratified K-Fold Cross Validation</h4><p>If the data is having high variations, a minor improvement is made in selecting the <strong>k </strong>subsets. Each set now is selected such that it contains the same percentage of samples of each target class. If a problem is a prediction one, mean response is made approximately in all the fields.</p><h4>Leave-P-Out Cross-Validation</h4><p>It involves some permutations and combinations. For n data points, you use n-p for train and p to validate. This is repeated for all possible cases for selecting this number of elements. And like the above two methods, finally, you average all errors obtained. When p=1, it becomes a special case and is called <strong>Leave one out cross validation.</strong></p><h3><strong>What I eventually did to evaluate the model?</strong></h3><p><strong><em>In the end, I went ahead with K-Fold validation and used k=14. </em></strong>This seemed appropriate given the limited amount of dataset I had. Though I landed getting only a respectable accuracy of 70% by virtue of the presence of less no. of similar dialogues. That is, say for training the dialogue model, I had two completely different dialogues mapping to the same intent. So, when one was in the validation set and the other in the training set, the model naturally ended up giving the wrong prediction!</p><p>This was it from this time around. I’ll be back next week with what more interesting things I’m doing this GSoC. Stay tuned.</p><p><strong>References:</strong></p><ol><li><a href="https://en.wikipedia.org/wiki/Cross-validation_(statistics)">https://en.wikipedia.org/wiki/Cross-validation_(statistics)</a></li><li><a href="https://www.kaggle.com/dansbecker/cross-validation">https://www.kaggle.com/dansbecker/cross-validation</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a7b37becc280" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Reuse components to minimize code]]></title>
            <link>https://medium.com/@lunayach/reuse-components-in-angular-c1097fad981c?source=rss-60ad26d2a968------2</link>
            <guid isPermaLink="false">https://medium.com/p/c1097fad981c</guid>
            <category><![CDATA[gsoc]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[angular2]]></category>
            <category><![CDATA[systers]]></category>
            <category><![CDATA[angular]]></category>
            <dc:creator><![CDATA[Mayank Lunayach]]></dc:creator>
            <pubDate>Mon, 23 Jul 2018 12:49:06 GMT</pubDate>
            <atom:updated>2018-07-25T21:13:42.661Z</atom:updated>
            <content:encoded><![CDATA[<p>One of the perks that come while using frameworks like Angular for development in JavaScript is an architecture based on components.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*g-K0_glNQ1xP3zU1" /><figcaption>Component based Architecture becomes easy to organize</figcaption></figure><p>You organize your code into small components and then you are free to use these components anywhere in the application like you would use a normal HTML tag. I’ll illustrate this with the recent use-case I experienced.</p><p>As I have elaborated in my earlier blogs, I am working on an application consisting of many games, this google summer of code. Our team decided to have multiple levels for all the games. Now, there are around 10 of these games. To navigate between levels, we should have a component in each application to navigate. Now, coding that same component 10 times in each application is certainly not a good idea also when it might go against uniformity in the app. There comes Angular in the picture, we just need to make the component once and then use it in other places in the application by using,</p><pre>&lt;app-level-navigate&gt;</pre><p>And way, we are increasing levels in each game will not be same. This game-level control for the component would be provided by the <strong>@Input</strong> class in Angular. That is,</p><pre>@Input private GameSpeificVariable</pre><p>So, with relatively fewer lines of code, I was able to increase level in all the activities. This was it from this time around… I’ll be back next week with what more interesting things I’m up to!</p><p>So, stay tuned. :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c1097fad981c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Have a fine control over your language processing pipeline with RASA]]></title>
            <link>https://medium.com/@lunayach/have-a-fine-control-over-your-language-processing-pipeline-with-rasa-5d2efab99967?source=rss-60ad26d2a968------2</link>
            <guid isPermaLink="false">https://medium.com/p/5d2efab99967</guid>
            <category><![CDATA[systers]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[gsoc]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[rasa-nlu]]></category>
            <dc:creator><![CDATA[Mayank Lunayach]]></dc:creator>
            <pubDate>Mon, 16 Jul 2018 14:54:39 GMT</pubDate>
            <atom:updated>2018-07-16T15:01:10.036Z</atom:updated>
            <content:encoded><![CDATA[<p>This week started with some nervousness as GSoC 2nd evaluation was around the corner. Glad, I was able to pass it! For the next phase, I just want to be strict and punctual with my deadlines.</p><p>In the last blog, I had mentioned a ChatBot I was working on as a part of my GSoC project. No dialogue dataset was available beforehand, so we had to create a new one. Also, to make conversations more productive and meaningful, I had to extract information from the sentence itself. Like this,</p><pre>Is it safe to take Atovaquone?</pre><p>I need to retrieve the name “Atovaquone” and store it in a variable called ‘medicine’. The process is called <strong>Entity Extraction.</strong> So, how do we proceed with it?</p><p>As I mentioned in the previous blog, I was using <strong>RASA</strong> framework to pre-process dialogues and then later training the model. Things like entity extraction, intent extraction etc. are handled by RASA NLU. All these pre-processing is not done in one step. Instead, we have a pipeline for doing it. That is, the output of one component becomes the input of other. Default pipeline is this:</p><pre><strong>pipeline:</strong><br>- <strong>name</strong>: &quot;nlp_spacy&quot;<br>- <strong>name</strong>: &quot;tokenizer_spacy&quot;<br>- <strong>name</strong>: &quot;intent_entity_featurizer_regex&quot;<br>- <strong>name</strong>: &quot;intent_featurizer_spacy&quot;<br>- <strong>name</strong>: &quot;ner_crf&quot;<br>- <strong>name</strong>: &quot;ner_synonyms&quot;<br>- <strong>name</strong>: &quot;intent_classifier_sklearn&quot;</pre><p>As you can see, it is using <strong>Spacy</strong> for tokenization, intent featurization etc. and <strong>Scikit-Learn</strong> for intent classification. For entity extraction, it is using <strong>crfsuite </strong>(“<strong>ner_crf</strong>” in the above configuration). This is known to work well for custom entities. But, in my case, the results were not that satisfactory. That is, even if the test dialogue missed one character from training dialogue, it failed to extract the entities. It hinted towards the requirement of more dialogues. In my case, this was not a feasible option.</p><p>I found out <strong>MITIE</strong> to be working well with entities. So, the current configuration is “MITIE + Scikit-Learn”.</p><pre><strong>pipeline:<br></strong>- <strong>name: </strong>&quot;nlp_mitie&quot;<br>  <strong>model: </strong>&quot;total_word_feature_extractor.dat&quot;<br>- <strong>name: </strong>&quot;tokenizer_mitie&quot;<br>- <strong>name: </strong>&quot;ner_mitie&quot;<br>- <strong>name: </strong>&quot;ner_synonyms&quot;<br>- <strong>name: </strong>&quot;intent_entity_featurizer_regex&quot;<br>- <strong>name: </strong>&quot;intent_featurizer_mitie&quot;<br>- <strong>name: </strong>&quot;intent_classifier_sklearn&quot;</pre><p>Another alternative is maybe to use <strong>MITIE </strong>for the complete process, but it becomes <strong>slow </strong>with it to train a model of even 50 lines!</p><p>So, here we are with a pipeline extracting intents and entities well. Thanks to the RASA framework, which makes such configurations a piece of cake!</p><p>I’ll back next week, with more cool things I am doing. Stay tuned. :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5d2efab99967" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GSoC Week 8: Live]]></title>
            <link>https://medium.com/@lunayach/gsoc-week-8-live-981060bb5b38?source=rss-60ad26d2a968------2</link>
            <guid isPermaLink="false">https://medium.com/p/981060bb5b38</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[systers]]></category>
            <category><![CDATA[gsoc]]></category>
            <category><![CDATA[rasa-nlu]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[Mayank Lunayach]]></dc:creator>
            <pubDate>Mon, 09 Jul 2018 14:30:40 GMT</pubDate>
            <atom:updated>2018-07-09T15:10:26.892Z</atom:updated>
            <content:encoded><![CDATA[<p>So here we are! On the edge of the second evaluation. I did a couple of essential tasks this week.</p><p>First one was the implementation of ChatBot for our app. This ChatBot would try to impersonate a doctor and answer the questions related to Malaria. I initially went ahead with the approach given in this <a href="https://arxiv.org/pdf/1506.05869.pdf">paper</a>. It was published by Google a few years ago but had some impressive results that prompted me to follow it. Here is the glimpse of results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/365/1*mbMVf3ImZSFF515Y07Pmdg.png" /><figcaption>It’s response on test cases</figcaption></figure><p>As you may see, the results are bit random. Also, the language is not formal either. (Reason, it was trained on a very popular <a href="https://www.cs.cornell.edu/~cristian/Cornell_Movie-Dialogs_Corpus.html">Cornell Movie Dialogue Corpus</a>, and needed some more hyperparameter tuning). The behaviour may not be ideal for a Doctor ChatBot where accuracy is of prime importance.</p><p>Then I shifted towards making Retrieval bot based on our dataset. Our own dataset would ensure, that responses are more predictable and meaningful. it’s impossible to make a dataset that would cater to all situations, both effort and time wise. So I just trained it for handful no. of sentences at the beginning (say 5–10). I was using <a href="https://rasa.com/">Rasa Framework</a> for this.</p><p>In the framework, one of the components is Rasa NLU for Natural Language Processing. So, even if my query is not among those 5–10 but is somewhat similar, it recognises the intent and maps to the predefined actions. One more cool thing about Rasa is about how you can configure it according to your needs. Example, since it uses Keras to train the model, so we can even tweak parameters like LSTM layers, accuracy matrices etc. as per our needs.</p><p>Later, I implemented a LeaderBoard for our application. Since the app is primarily made up of games, so having a LeaderBoard which ranks different users based on points earned, makes sense. Here, the task was to write the backend code for ranking the users. Users are ranked in their badge categories. A small excerpt from the code.</p><pre>if (<em>req</em>.<em>body</em>) {<br>    <em>progress</em>.findAll({<br>        <em>include</em>: [<em>localUser</em>],<br>        <em>where</em>: {<em>badge</em>: <em>req</em>.<em>body</em>.<em>badge</em>},<br>        <em>order</em>: [<br>            [&#39;score&#39;, &#39;DESC&#39;],<br>        ]<br>    }</pre><p>So, this was it from my GSoC week work this time. I’ll be back next week! Stay tuned. :D</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=981060bb5b38" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Gain fine control over animations with JQuery]]></title>
            <link>https://medium.com/@lunayach/gain-fine-control-over-animations-with-jquery-5e562dd2dd77?source=rss-60ad26d2a968------2</link>
            <guid isPermaLink="false">https://medium.com/p/5e562dd2dd77</guid>
            <category><![CDATA[jquery]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[gsoc]]></category>
            <category><![CDATA[systers]]></category>
            <category><![CDATA[games]]></category>
            <dc:creator><![CDATA[Mayank Lunayach]]></dc:creator>
            <pubDate>Mon, 02 Jul 2018 14:58:06 GMT</pubDate>
            <atom:updated>2018-07-02T14:58:06.014Z</atom:updated>
            <content:encoded><![CDATA[<p>I’ll be writing about a very cool feature of popular JavaScript framework, JQuery. If you are not familiar with what it is, I’ll suggest you check out its <a href="https://jquery.com/">official website</a>.</p><p>In my <strong><em>GSoC’18</em></strong> project this week, I worked on a JavaScript game. There I had to detect collision between two objects. You may figure out, that a simple function which would account for positions of objects using offsets and positions would work well, like this, which checks for a collision between two JQuery elements, a &amp; b.</p><pre>checkCollison(<em>a</em>, <em>b</em>) {<br>  if (<em>a</em>.offset().<em>left </em>&lt; <em>b</em>.offset().<em>left </em>+ <em>b</em>.width() &amp;&amp; <em>a</em>.offset().<em>left </em>+ <em>a</em>.width() &gt; <em>b</em>.offset().<em>left </em>&amp;&amp; <em>a</em>.offset().<em>top </em>&lt; <em>b</em>.offset().<em>top </em>+ <em>b</em>.height() &amp;&amp; <em>a</em>.height() + <em>a</em>.offset().<em>top </em>&gt; <em>b</em>.offset().<em>top </em>) {<br>    return true;<br>  }<br>}</pre><p>This works well when you have control over the movement of two objects, and you call the function whenever you need to check collision. But what if one of the objects is being randomly animated using <em>.animate() </em>method. Like many animation libraries, we do have an option for a callback function, that we can all after the animation ends. But a catch here! We would be detecting collision only when the animation ends. We need something that allows us to interact with the object even while it is animating.</p><p>And we do have that thing, a <strong>step()</strong> function that is called appx. every 30ms and detects the changes to the properties of the object during animation. Like this,</p><pre>Element.animate({ <em>-new positions- </em>}, {<br>    <em>duration</em>: -duration of animation in ms-,<br>    step: function() {<br>     -check collision-<br>    },<br>    done: function () {<br>     -what to do, when animation ends-<br>}});</pre><p>You can read more about the animate API <a href="http://api.jquery.com/animate/">here</a>.</p><p>I’ll be back next week with what interesting things I’m doing, in the GSoC. Stay tuned. :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5e562dd2dd77" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Get the Tensorflow running with GPU (Ge Force / Titan) support Ubuntu 18.04]]></title>
            <link>https://medium.com/@lunayach/get-the-tensorflow-running-with-gpu-ge-force-titan-support-ubuntu-18-04-6fa764f44bd4?source=rss-60ad26d2a968------2</link>
            <guid isPermaLink="false">https://medium.com/p/6fa764f44bd4</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[tensorflow]]></category>
            <category><![CDATA[nvidia]]></category>
            <category><![CDATA[ubuntu]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Mayank Lunayach]]></dc:creator>
            <pubDate>Mon, 25 Jun 2018 15:39:07 GMT</pubDate>
            <atom:updated>2018-06-25T15:42:47.208Z</atom:updated>
            <content:encoded><![CDATA[<p>So a very important question. Why GPU?</p><p>Using a GPU isn’t strictly necessary, but it’s strongly recommended. You can run the Tensorflow programs on a laptop CPU but you may sometimes have to wait for several hours for a model to train, instead of mere minutes in a good GPU. To have our Tensorflow be utilising GPU, we’ll need to install two things,</p><ol><li>CUDA: A set of drivers for your GPU that allows it to run a low-level programming language for parallel computing.</li><li>cu DNN: A library of highly optimized primitives for deep learning. When using cu DNN and running on a GPU, you increase the training speed by 50% to 100%.</li></ol><p>But having Ubuntu18.04 with NVIDIA cards, the install may get a bit tricky. Because NVIDIA is yet to release a tested CUDA for Ubuntu18.04. See here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RodiaL9ye-LMh4aNJol5LQ.png" /><figcaption>No 18.04 yet!!</figcaption></figure><p>Also, when installing CUDA toolkit from above (say you choose the nearest, 17.10 version), it has the dependency of NVIDIA-396.26 drivers. Now, this is a <strong>Tesla Driver! </strong>(You can go to NVIDIA driver download <a href="http://www.nvidia.com/Download/index.aspx?lang=en-us">page</a> and check) It would not work on your GeForce or titan Machine. Equivalent driver for Ge Force/ Titan is the version 396.24. It’s luckily available in Graphic Drivers PPA.</p><p>To install it from there, go to ‘Software &amp; Updates’ menu and select ‘Additional Drivers’ option.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*yHbMQ5BQ-WKL8t3SZLn-wA.png" /><figcaption>Select the same option that I have selected above.</figcaption></figure><p>Once you have the drivers installed, install the CUDA dependencies.</p><pre>sudo apt-get install freeglut3 freeglut3-dev libxi-dev libxmu-dev</pre><p>Now, go to CUDA website and get a run-file installer. We are using a run-file installer to ensure that we are having a control over the entire installation process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*omGITDwzR--pJK7czt6rOA.png" /><figcaption>Choose the runfile (local) option</figcaption></figure><p>Run the installer, accept the terms and conditions, say yes<strong> </strong>to install with an unsupported configuration, and no to “Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 396.26?” The reason, we had already installed the drivers earlier.</p><p>After that, you would have to set some path variables. A very comprehensive guide is available for that. Follow <a href="https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#post-installation-actions">this</a>. Doing actions under the “Mandatory Actions” worked for me.</p><p>Now the hard part is done. Then,</p><p><strong>Install CUDNN form the </strong><a href="https://developer.nvidia.com/cudnn"><strong>link</strong></a><strong>. </strong>(Would require to make an NVIDIA account first, would not take more than 5 minutes) <br>Choose an installer and follow their <a href="https://docs.nvidia.com/deeplearning/sdk/cudnn-install/index.html">comprehensive guide</a>.</p><p>Yup!! That’s it. To check whether your Tensorflow is using GPU. Open a Python/Python3 session from terminal and type</p><pre>from tensorflow.python.client import device_lib<br>print(device_lib.list_local_devices())</pre><p>If you see your GPU installed in the output. Congrats! you just configured your laptop for some superfast model training.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6fa764f44bd4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GSoC Live: Week 5]]></title>
            <link>https://medium.com/@lunayach/gsoc-live-week-5-fe3640904a52?source=rss-60ad26d2a968------2</link>
            <guid isPermaLink="false">https://medium.com/p/fe3640904a52</guid>
            <category><![CDATA[angularjs]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[bootstrap]]></category>
            <category><![CDATA[rxjs]]></category>
            <category><![CDATA[systers]]></category>
            <dc:creator><![CDATA[Mayank Lunayach]]></dc:creator>
            <pubDate>Mon, 18 Jun 2018 16:30:50 GMT</pubDate>
            <atom:updated>2018-06-18T16:30:50.265Z</atom:updated>
            <content:encoded><![CDATA[<p>So it was the week of the evaluation. Honestly, was a bit nervous but was thrilled after reading reviews of mentors. I am indeed aware of the mistakes I did this month, would try not to repeat them.</p><p>Earlier part of the week went to address the review comments of mentors. That’s the beauty of open source! It’s not about having the job done. The way and coding styles are equally important. Thanks to my mentors as now I have started to think a bit about design patterns and techniques as well.</p><p>Later part went to mostly UI things. Earlier we were using plain bootstrap in the Registration form. I shifted it to material design. Must confess, material forms save you a lot of work! Also, error handling is easier than before with <strong>&lt;mat-error&gt;.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*coELL4IvUA6d9RwthgIKAQ.png" /><figcaption>Earlier (with Bootstarp)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7-EWsgQp0UmAOVuAa2Inww.png" /><figcaption>Now (after using Angular Material)</figcaption></figure><p>Then I worked on creating a Badge Service. The service would be used to award the player badges upon completing activity stages. To make it more interactive, I decided to experiment with Animations module of Angular. It initially can be a tough going with its syntax and all, but once you get a hold of it, everything seems to make a lot of sense.</p><p>But there was a challenge. How shall I fire this animation trigger from an utterly alien component? One way was to use the Event Emitter( ), class. The approach would have required to make hidden selectors for all the game components and then make them respond upon event emitting. Instead, I made a notifier service which now acts as a link between my game components and badge component. So basically, when the player completes the stage, I notify the service which has already subscribed to my events. Meanwhile, I also have an Observable sitting in the same notifier service, which emits upon the resolving the above subscription. Further I also have subscribed to this Observable in my badge component.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*YVE33ydvCb5p71ZavTi90A.png" /><figcaption>The Notify Service</figcaption></figure><p>Now It’s an exciting time for my GSoC. I would work on improving the existing ChatBot. Next week, I’ll be there with my progress in it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fe3640904a52" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GSoC Live: Week 4]]></title>
            <link>https://medium.com/@lunayach/gsoc-live-week-4-85946ae7fd73?source=rss-60ad26d2a968------2</link>
            <guid isPermaLink="false">https://medium.com/p/85946ae7fd73</guid>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[systers]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[gsoc]]></category>
            <category><![CDATA[ui]]></category>
            <dc:creator><![CDATA[Mayank Lunayach]]></dc:creator>
            <pubDate>Mon, 11 Jun 2018 14:38:59 GMT</pubDate>
            <atom:updated>2018-06-11T14:43:34.500Z</atom:updated>
            <content:encoded><![CDATA[<p>Before moving to what I did in this week, I just realised that it’d been a one month doing GSoC already! Amazing how this time flew!</p><p>The first part of the week went in incorporating the changes suggested in previous PRs in the weekly meeting. I had already implemented two JavaScript games and their logic, (I have described about them in previous blogs: <a href="https://medium.com/@speedspeeder1/live-gsoc-week-ii-758ae6ac3928">Blog2</a> <a href="https://medium.com/@speedspeeder1/gsoc18-week-3-live-9235d43d65ff">Blog3 </a>) Now I had to work on new background images. I was dazzled realising how much difference a background image can make!! A big thanks to Buddhiprabha and Shreyans, my mentors who suggested the changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*k3E4XxOsdLVfLcRas_izKA.png" /><figcaption>Isn’t this looks natural? Compares with the one in <a href="https://medium.com/@speedspeeder1/live-gsoc-week-ii-758ae6ac3928">Blog 2 </a>:P</figcaption></figure><p>Then there were some changes suggested in other game as well. Previously no. of objects in the game path were limited, and their position was fixed as well. That’s a bit boring.. Right? So thanks to my mentors again who suggested me to make this thing more random. Currently, I can choose a random subset from a given set and then position them randomly on the canvas. Trust me; JavaScript arrays are fun to play with.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rxPFp8HHPKlSpqxdSceSQw.png" /><figcaption>Selecting and positioning objects Randomly</figcaption></figure><p>Next, I had to make a Profile Update component which was earlier not there. But there was a challenge, how would I update the user profile WITHOUT refreshing the page. I spent hours thinking over it. But I found a very fresh and logical solution to it. Gone are those non-Angular days, when we would naively call<em> </em><strong><em>location.reload()</em></strong>. With the angular components, we can call <strong><em>ngOnInit()</em></strong> function again! This was indeed a very satisfactory solution!!</p><p>Then came the part I’m honestly not good at. Give me the colours, and I’ll come up with the worst combination from them. It was about improving the UI of the application. Again humble thanks to mentors for having those very productive discussions.</p><p>With just one month done and I have already started feeling more confident than before. And the last word for Systers community, trust me this community is fantastic! I have enjoyed every bit of time here.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=85946ae7fd73" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GSoC’18 : Week 3 Live]]></title>
            <link>https://medium.com/@lunayach/gsoc18-week-3-live-9235d43d65ff?source=rss-60ad26d2a968------2</link>
            <guid isPermaLink="false">https://medium.com/p/9235d43d65ff</guid>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[angular2]]></category>
            <category><![CDATA[karma]]></category>
            <category><![CDATA[systers]]></category>
            <dc:creator><![CDATA[Mayank Lunayach]]></dc:creator>
            <pubDate>Mon, 04 Jun 2018 16:47:16 GMT</pubDate>
            <atom:updated>2018-06-05T05:21:03.359Z</atom:updated>
            <content:encoded><![CDATA[<p>As I entered into week 3, my first task was to have all the previously written Angular tests pass. Doing this was a fantastic learning experience. <br>Like this one. Don’t cheat while doing testing. Hmmm. I had a couple of components which were using a service that emitted observables. I instead of mocking tried to go the component way. That is, I subscribed to the service first using .subscribe() and then when it resolved, wrote the UI testing specs. Well, it did the job but partially. When I tested only that component, it was good. Things, became terrible when I ran tests for the whole application. Received dreadful errors like “ng Context ERROR”</p><p>StackOverflow didn’t help either. Seeing, messages like ‘Context Error’ gave me intuitions that something may be wrong with that subscribe thing. So, I replaced all those .subscribe() usages with proper spying the service in place.</p><p>The latter part of the week was devoted to the creativity part. I made the second game “Stride Against Malaria.” I again used Raphael. I don’t know, but I’m in just love with the simplicity that this library offers while being wholly typed for Typescript. This was a touch complex from the previous one because this involved animated transformations. With great feedback from mentors in the weekly meeting, I was able to improve it further.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SgE3rl4XB105eJpOFYM7jA.png" /><figcaption>Screenshot from the game</figcaption></figure><p>All and all it was again a great learning experience this time round as well.</p><p>Edit-1: My previous blog, where I discussed about Raphael. <a href="https://medium.com/@speedspeeder1/live-gsoc-week-ii-758ae6ac3928">https://medium.com/@speedspeeder1/live-gsoc-week-ii-758ae6ac3928</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9235d43d65ff" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>