<?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 Neha Yadav on Medium]]></title>
        <description><![CDATA[Stories by Neha Yadav on Medium]]></description>
        <link>https://medium.com/@inehayadav28?source=rss-45907f868360------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*RtwTJCnfrybDFs00PFNM1A.jpeg</url>
            <title>Stories by Neha Yadav on Medium</title>
            <link>https://medium.com/@inehayadav28?source=rss-45907f868360------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 00:10:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@inehayadav28/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[Getting started with Google cloud datastore.]]></title>
            <link>https://medium.com/@inehayadav28/google-cloud-datastore-2663bb3099d4?source=rss-45907f868360------2</link>
            <guid isPermaLink="false">https://medium.com/p/2663bb3099d4</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <dc:creator><![CDATA[Neha Yadav]]></dc:creator>
            <pubDate>Fri, 23 Feb 2018 20:37:11 GMT</pubDate>
            <atom:updated>2018-02-24T10:31:31.737Z</atom:updated>
            <content:encoded><![CDATA[<p>Google cloud platform provides a series of modular cloud services and one of them is storage(Google cloud datastore). Small overview of google cloud platform.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1014/1*2wAluGSiRd1Fk6vN7LvI6A.png" /></figure><p>I am only introducing the storage part that is cloud datastore.To interact with gcloud datastore API is provided.</p><p>Document is provided by google to use API. But, I personally don’t like going through that long document again and again. It is good if you are beginner or first time reader but not every-time. I like things simple and to the point. You will see below how to CRUD in Google cloud datastore.</p><p>Before start I am expecting you downloaded the gcloud in your virtualenv</p><p>First import google client library and then Instantiates a client</p><pre>In [1]: from google.cloud import datastore<br>In [2]: ds_client = datastore.Client()</pre><ol><li><strong>C</strong>(create)<strong>RUD: </strong>We first create entity which represents single entity in the datastore. To create entity we need <strong>‘key’</strong></li></ol><pre>In [3]: key = ds_client.key(&#39;Org&#39;)<br>In [4]: key<br>Out[4]: &lt;Key(&#39;Org&#39;,), project=project-181809&gt;</pre><pre>In [5]: org = datastore.Entity(key=key)<br>In [6]: org<br>Out[6]: &lt;Entity(&#39;Org&#39;,) {}&gt;</pre><p>Right now our database is not saved. So far we prepared everything. It is not yet created/stored in our database. Now we will save org using <strong>put</strong>.</p><pre>In [7]: ds_client.put(org)</pre><p><strong>2. CR</strong>(read)<strong>UD: </strong>To read entity we will query using the name of Entity. Our entity name was <strong>‘Org’. </strong>After query we will fetch our data.</p><pre>In [8]: query_org = ds_client.query(kind=&#39;Org&#39;)<br>In [9]: list(query_org.fetch())<br>Out [9]: [&lt;Entity(u&#39;Org&#39;, 20L) {}&gt;]</pre><p>It might be possible that we have more than two entity with same name. Then we will include more filter to search the exact entity. You can add more filter. Below is a small example</p><pre>query_org.add_filter(&#39;&lt;property&gt;&#39;, &#39;&lt;operator&gt;&#39;, &lt;value&gt;)<br>&gt;&gt;&gt; query_org.add_filter(&#39;company_name&#39;, &#39;=&#39;, &#39;Google&#39;)</pre><p><strong>3. CRU</strong>(update)<strong>D</strong></p><pre>In [10]: data = {<br>    ...:     &#39;name&#39;: &#39;Monty Don&#39;,<br>    ...:     &#39;position&#39;: &#39;Software Developer&#39;<br>    ...: }<br>In [11]: org.update(data)<br>In [12]: org<br>Out[12]: &lt;Entity(&#39;Org&#39;, 20L) {&#39;position&#39;: &#39;Software Developer&#39;, &#39;name&#39;: &#39;Monty Don&#39;}&gt;<br>In [13]: ds_client.put(org)</pre><p>Always use <strong>put</strong> to update you database. Use put when you are creating new entity and adding new data</p><p><strong>4. CRUD</strong>(delete): To delete entity we fetch the key from the query. We can update or delete fields as well by accessing dictionary keys and values but here I am showing how we can delete whole entity.</p><p>Their are two ways to delete entity. First by client and another by client batch. I am deleting directly by client you can see <a href="https://googlecloudplatform.github.io/google-cloud-python/latest/datastore/usage.html#google.cloud.datastore.Batch"><strong>here</strong></a><strong> </strong>how to delete with batch.</p><pre>In [14]: get_org = list(query.fetch())[0]<br>In [15]: org_key = get_org.key<br>In [16]: org_key<br>Out[16]: &lt;Key(u&#39;Org&#39;, 20L), project=project-181809&gt;<br>In [17]: ds_client.delete(org_key)</pre><p>References:</p><ol><li><a href="https://github.com/GoogleCloudPlatform/getting-started-python">Getting started with python gcloud datastore</a></li><li><a href="https://github.com/google/google-api-python-client">Google api python client</a></li><li><a href="https://googlecloudplatform.github.io/google-cloud-python/latest/datastore/usage.html">Gcloud datastore python</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2663bb3099d4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My summer experience with Mozilla -Servo]]></title>
            <link>https://medium.com/@inehayadav28/my-summer-experience-with-mozilla-servo-2643c1385b03?source=rss-45907f868360------2</link>
            <guid isPermaLink="false">https://medium.com/p/2643c1385b03</guid>
            <category><![CDATA[rgsoc]]></category>
            <category><![CDATA[mozilla]]></category>
            <category><![CDATA[rust]]></category>
            <category><![CDATA[servo]]></category>
            <dc:creator><![CDATA[Neha Yadav]]></dc:creator>
            <pubDate>Fri, 24 Nov 2017 02:05:46 GMT</pubDate>
            <atom:updated>2017-11-24T02:11:57.729Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9c0i09VxYGILjZJ0Vc7NlQ.jpeg" /><figcaption>Source: Google</figcaption></figure><p>I was writing my first blog from last two month and waited for the right time to post. And Mozilla quantum is released last week(Nov 14, 2017) I think this is the best time to share my contribution to the servo.</p><p><strong>Quickstart with servo intro:</strong></p><p><a href="https://servo.org/"><strong>Servo</strong></a> is a modern, high-performance browser engine designed for both application and embedded use developed by Mozilla Research. The goal is to create a new layout engine using a modern programming language (Rust), and using parallelism and code safety, to achieve greater security and performance versus contemporary browsers. Servo began in 2013 and there are so many easy tasks waiting for rust contributors. So, go pals hack on servo :) Servo developers merged part of the servo in firefox and launched Mozilla Quantum.</p><p>I chose this video among all the available latest video because everyone watched the power of servo in Firefox quantum but, only this video will show you how it all started. <strong>An Introduction to Servo</strong></p><p><a href="https://air.mozilla.org/an-introduction-to-servo-2/video/">An Introduction to Servo</a></p><p>I was the part of RGSoC intern. Me and my friend Rakhi contributed together to this project. A big thanks to RGSoC community to come up with so many good projects.</p><p><strong>Summer experience with servo</strong></p><p>My major work was to write algorithm and test cases for parse srcset attribute in Rust.</p><p><strong>Srcset: </strong>It defines the set of images we will allow the browser to choose between, and what size each image is.<strong> </strong>The srcset attribute specifies the URL of the image to use in different situations.</p><p>After the basic intro of srcset I started with the standard specification of <a href="https://html.spec.whatwg.org/multipage/images.html#parsing-a-srcset-attribute">parsing srcset attribute</a>. The language used in the specification was hard at first to understand but with help of servo contributor especially my mentor <a href="https://twitter.com/lastontheboat">Josh</a> and coaches <a href="https://twitter.com/creativcoder">Rahul</a> and <a href="https://blog.waffles.space/">Ravi</a>, it was easy. Ask on IRC #servo channel if anyone is planning to contribute and stuck with the specification.</p><p><strong>What Rust taught me:</strong></p><p>Rust was new for me and I never used it before so learning and implementing rust features within summer was a little bit tough. But I learned and implemented some good features of rust. Few mentioned below:</p><ul><li>match: It replaces complicated if/else or it can also be used as C switch.</li><li>Generic Data Type: It is more flexible, provides more functionality and removes code duplication.</li><li>try: try execute the closure, passing it to the parser.</li><li>loop { } : Rust provides a loop keyword to indicate an infinite loop. The break statement can be used to exit a loop at any time, whereas the continue statement can be used to skip the rest of the iteration and start a new one.</li><li>Bindings: You can bind values to names with @ .(Note: I used this a lot in my code )</li></ul><p>Ravi taught me very good hack on git. I’ll share that on my next blog.</p><p>You always learn from the problem you faced and I am sharing the solution to all the challenges that I faced.</p><p>Rahul taught me <a href="https://html.spec.whatwg.org/multipage/introduction.html#how-to-read-this-specification">How to read specification:</a><br>1. Read cover-to-cover, multiple times.<br>2. Read backwards at least once. <br>3. Read by picking random sections contents and following all cross-references.<br>4. Define italic type word a variable.<br>5. Define static or enum if something is followed by “is a”.</p><p><strong>Build and run servo: </strong>Servo is a huge project and building servo on my ubuntu take more than 2hr. I noticed that people never share their build problems and hack to solve them. So I am sharing what to do when you are building a large project on the low configurated system. <br>1. <a href="https://janitor.technology/"><strong>Janitor</strong></a><strong>:</strong> a simple web app that uses cloud9. An easy way to contribute to Firefox developer tools. Everything happens on the web and it doesn’t require any download and installation. It builds your code as fast as possible. Because it is web-based, so your code is always there for you, on any device. (I always trouble <a href="https://twitter.com/jankeromnes">Jan</a> if Janitor troubles me :P Thanks for being so supportive)<br>2. Create a separate new rust project and inside <a href="http://lib.rs/">lib.rs</a> paste all the code you wrote and run using cargo test. (Note: I did this with the help of my mentor(Josh). If you want to build this way then take someone help from servo maintainer to clone only necessary files)</p><p>My overall experience of summer with servo was great. I am happy that I contributed to the servo. The benefit of contributing to a huge project like servo, is that it pushes your limit of grasping knowledge. I’ll continue my contribution to the servo :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2643c1385b03" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>