<?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[pyankit - Medium]]></title>
        <description><![CDATA[Sharing experiences on technology, python and Data Science - Medium]]></description>
        <link>https://medium.com/pyankit?source=rss----8dc00b20aa90---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>pyankit - Medium</title>
            <link>https://medium.com/pyankit?source=rss----8dc00b20aa90---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 22:12:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/pyankit" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Postgres Range Types are dope]]></title>
            <link>https://medium.com/pyankit/postgres-range-types-are-dope-ca18923f3d46?source=rss----8dc00b20aa90---4</link>
            <guid isPermaLink="false">https://medium.com/p/ca18923f3d46</guid>
            <category><![CDATA[postgresql]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[postgres]]></category>
            <category><![CDATA[database]]></category>
            <dc:creator><![CDATA[Ankit Mittal]]></dc:creator>
            <pubDate>Tue, 10 Jul 2018 04:10:33 GMT</pubDate>
            <atom:updated>2018-07-10T04:10:32.767Z</atom:updated>
            <content:encoded><![CDATA[<p>Range types are a big differentiator of postgres, and they are awesome. Range types allows storing two dimensions of data in a single column. Many data modeling possibilities come true after combining them with the unique and constraint indexes that can be added.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pgmjZY4Qtp88_e2cWAjLAg.png" /><figcaption>Screenshot from Postgres 10 documentation, showing different range types available.</figcaption></figure><p><strong>1. Financial Instruments pricing</strong></p><p>These range types can be used off the shelf when using postgres as the primary database. For an application developer, range types naturally yield to the real world applications. For example, if you want to store price of any financial instrument, the price has a validity period associated with it. This <a href="https://www.imf.org/external/np/fin/data/rms_mth.aspx?SelectDate=2018-07-31&amp;reportType=CVSDR">report from IMF</a> shows currency data for fiats and for cryptoassets the pricing can be sourced from coinmarketcap’s historical table. Following datamodel can support this data.</p><pre>create table currency_rates<br> (<br>  symbol text,<br>  validity daterange,<br>  rate     numeric<br> );</pre><p><strong>2. Engineering values with tolerance</strong></p><p>There are many engineering values/metrics which are not exact values but are numbers with a tolerance example acceptable torque wrench accuracy in mechanical engineering. Most of the numbers associated with analog machines occur in a range, postgres integer range or numrange works perfectly for such scenarios.</p><p><strong>3. Budgets and time scheduling</strong></p><p>Modeling any negotiable quantity like a timeline or budget can be best modeled over an acceptable range than a single value. As we will see later availability of uniques and overlap constraints on ranges allow you to model the real life constraints in database and not in your application. A machine’s availability for accepting new work in a time period does not belong to application logic but belongs to a hard core database constraint. Considering concurrency issues and race condition possibilities in application code, database constraints are much more reliable for real world constraints.</p><h3>Range bounds</h3><p>Bounds can be finite or infinite, inclusive or exclusive. From postgres official documentation</p><blockquote>The lower bound of a range can be omitted, meaning that all points less than the upper bound are included in the range. Likewise, if the upper bound of the range is omitted, then all points greater than the lower bound are included in the range. If both lower and upper bounds are omitted, all values of the element type are considered to be in the range.</blockquote><blockquote>An inclusive bound means that the boundary point itself is included in the range as well, while an exclusive bound means that the boundary point is not included in the range.</blockquote><p>Default choice is lower bound is inclusive and upper bound is exclusive. Even though this choice may seem like not a logical choice but this has been the traditional way ranges have been used in mathematics.</p><p><strong>Few practical examples on the blogosphere:</strong></p><ol><li>Crunchy data folks have posted interesting blog post on how to create a travel scheduler. <a href="http://info.crunchydata.com/blog/range-types-recursion-how-to-search-availability-with-postgresql">http://info.crunchydata.com/blog/range-types-recursion-how-to-search-availability-with-postgresql</a></li><li>Using intrange in postgres for modeling geoIP <a href="https://illuminatedcomputing.com/posts/2016/06/inet-range/">https://illuminatedcomputing.com/posts/2016/06/inet-range/</a></li></ol><h3><strong>Querying and Operators</strong></h3><p><em>Sorting can be done either by lower limit or upper limit, using </em><strong>UPPER and LOWER operators.</strong></p><p>Overlap queries : SELECT * FROM currency_prices WHERE validity &amp;&amp; tsrange(t1,t2, ‘[]’)<br>This returns list of rows of currency prices which have overlapping range from t1 to t2 timestamp.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fUQdSDl0iraZML5vDOAOTQ.png" /><figcaption>Complete list of postgres range operators from postgres documentation</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a5M4y9qzp3CdB7izK4_Hcg.png" /><figcaption>Complete list of functions that can be used while querying range data types</figcaption></figure><h3>Constraints and Indexes</h3><p>Having a GiST index, can speed up almost all operations. &amp;&amp; (overlap), &lt;@ (contained by), @&gt; (contains), &lt;&lt; (strictly less than), &gt;&gt; (strictly greater than), -|- (adjacent), &amp;&lt; (does not extend more than), &amp;&gt; (does not extend less than).</p><p>GiST can be combined with Btree as well, by using the extension btree_gist. This allows you to have complex queries made fast like:</p><p>SELECT * FROM currency_prices WHERE symbol=’CHSB’ AND validity &amp;&amp; tsrange(t1, t2).</p><p>BTree part is used for quality and Gist for overlap operator.</p><p>Overlap constraints can be added also using GIST and BTREE GIST. This is one of the most helpful features while doing range modeling. It allows us to add constraints like at a specific time only one price can exist for a currency symbol.</p><blockquote>ALTER TABLE currency_price ADD CONSTRAINT validity_overlap EXCLUDE using GIST (currency_symbol with =, validity with &amp;&amp;);</blockquote><blockquote>Isnt this dope ? ♥ ♥ I found it dope.. pretty sure you would too. Do write in comments use cases you can think of for postgres range types.</blockquote><p><strong>Fun fact:</strong> Django supports range types. Check them out <a href="https://docs.djangoproject.com/en/2.0/ref/contrib/postgres/fields/#range-fields">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ca18923f3d46" width="1" height="1" alt=""><hr><p><a href="https://medium.com/pyankit/postgres-range-types-are-dope-ca18923f3d46">Postgres Range Types are dope</a> was originally published in <a href="https://medium.com/pyankit">pyankit</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[You are not doing microservices correctly if]]></title>
            <link>https://medium.com/pyankit/you-are-not-doing-microservices-correctly-if-5c289f11d4b0?source=rss----8dc00b20aa90---4</link>
            <guid isPermaLink="false">https://medium.com/p/5c289f11d4b0</guid>
            <category><![CDATA[system-architecture]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[best-practices]]></category>
            <dc:creator><![CDATA[Ankit Mittal]]></dc:creator>
            <pubDate>Mon, 05 Feb 2018 00:36:09 GMT</pubDate>
            <atom:updated>2018-02-05T00:36:08.925Z</atom:updated>
            <content:encoded><![CDATA[<ul><li>You share databases</li><li>You share caches and other ‘stateful’ stores</li><li>You cannot deploy as single microservice without touching others</li><li>You cannot update schema of one of the services without causing problems in others</li><li>You differentiate between third party services and services of other teams</li><li>You split out new services without a solid business or technology reasoning. (monoliths are bad is not acceptable)</li><li>You do not have a well defined and written service boundary for all the microservices</li><li>You cannot debug and test single microservice</li><li>The Default method (most used) for inter-service communication is http</li></ul><p>There will be times when the urges to stomp on any of these strict rules with be very strong, be mindful of the fact that <strong>There be dragons </strong>on the way.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5c289f11d4b0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/pyankit/you-are-not-doing-microservices-correctly-if-5c289f11d4b0">You are not doing microservices correctly if</a> was originally published in <a href="https://medium.com/pyankit">pyankit</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tools for achieving devOps goals]]></title>
            <link>https://medium.com/pyankit/tools-for-achieving-devops-goals-808fc8a0c4eb?source=rss----8dc00b20aa90---4</link>
            <guid isPermaLink="false">https://medium.com/p/808fc8a0c4eb</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[tools]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[continuous-delivery]]></category>
            <category><![CDATA[jenkins]]></category>
            <dc:creator><![CDATA[Ankit Mittal]]></dc:creator>
            <pubDate>Wed, 24 Jan 2018 03:13:24 GMT</pubDate>
            <atom:updated>2018-01-24T04:14:47.535Z</atom:updated>
            <cc:license>http://creativecommons.org/publicdomain/zero/1.0/</cc:license>
            <content:encoded><![CDATA[<p>DevOps as a concept can be confusing, especially for engineers like me who have not spent much time in operations. Devops has been referred to teams, practices, tools, policies and even culture. Devops as a term started with culture and slowly moved towards being more tactical. This post is about the tools that can be called ‘<em>devOps tools’ </em>as they can be used by teams to achieve their devops goals.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cobQeEpOqM2LSTb8EUZXdQ.jpeg" /></figure><p>Although ops maturity will not come to teams just by picking the right tools, understanding them is a good first step in that direction. Do these tools make sense to you and your team, will be determined by your goals and the constraints you have. I have tried to enlist the tools and their usage here which worked for my team.</p><p><strong>CloudWatch Metrics and Alerts</strong>: Monitoring infrastructure (inc. servers, databases) and even Applications can be hooked into Cloudwatch for metrics. NewRelic is also good and provides much better Application Monitoring services but has much higher pricepoint.</p><p><strong>ELK (ElasticSearch, Logstash, Kibana) stack: </strong>Storing fresh logs (usually few weeks) for search, filter and exploration. Old logs can be pushed to cheaper storage accessible for auditing. One problem with this is aggregations cannot be trusted since Elastic Search makes assumptions while giving you estimate of your aggregations which may not always be accurate.</p><p><strong>Graffana</strong>: Pretty dashboards for metrics.</p><p><strong>Jenkins</strong>: Automation (especially build automation), running manual jobs which are not yet automated completely. Has good integration with github triggers and spinnaker. Since it is self hosted, it can run within your Virtual Private Cloud.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5B782j-cve95JtF7ICOwkg.jpeg" /><figcaption>Deploying a changeset to production</figcaption></figure><p><strong>Spinnaker</strong>: Many developers confuse spinnaker’s usefulness with Jenkins and considers it as an alternative with slightly nuanced features. However, both play along nicely together and have different strengths. It gives you out of the box features for blue/greed deployments, baking AMIs (Amazon machine Image), cluster resizing, updating instance type / properties, rollbacks. With some thoughtful planning it can also do database migrations deployments as pre-requisite to code deployments depending on your workflow. What it does really well is breaks down a big jenkins pipeline into small, modular stages which can be independently managed, rollbacked etc. Ways of spinnaker forces you into the ‘immutable infrastructure’ mental model. You can either create infrastructure pieces or destroy them, cant modify. This -&gt;<a href="https://medium.com/netflix-techblog/global-continuous-delivery-with-spinnaker-2a6896c23ba7">blogpost</a> is a good starting point for <a href="https://medium.com/netflix-techblog/global-continuous-delivery-with-spinnaker-2a6896c23ba7">Spinnaker</a>. One big problem with spinnaker is the configurations live in spinnaker and not in code or a repository so they dont really conform with the git workflow.</p><p><strong>CloudFormation/Sceptre</strong>: CF is infrastructure as code, lives in your version control. Sceptre allows you to pass variables and parameters to CF according to environment (dev/staging/prod etc) and other dimensions. Sceptre is what truly makes CF flexible and usable across all stack without any other complicated mechanisms.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*odstHeuu4epA2Qe7bFVBXg.jpeg" /></figure><p><strong>Trello/Jira</strong>: Planning, breaking down tasks is vital for achieving devops goals. Use any of your favourite method for project management here as well. Also these tools keep rest of the team abreast with the status of tasks.</p><p><strong>Make</strong>: As a very new make convert, I have to add Make to a good ‘devops’ toolkit. If you are still on the other side and wondering why even use Make over ‘bash/&lt;insert any alternative&gt;’, I strongly suggest you just try it for one project and you would start wondering why ever use anything else.</p><p><strong>Ansible</strong>: Standard configuration management, much like <em>Chef</em>, <em>Puppet</em>, and <em>Salt. </em>I prefer it just because it is written in python and its easy to dive into its codebase anytime needed. I dont prefer to use it as a <em>deployment-tool </em>because modifying servers can be a big trap. It is just a preference for me, not necessarily a gospel of truth. In case situations demand, ansible can act as a very good tool for it too.</p><p>If you have reached till the end, that means you are 1. Interested in Devops and 2. New to it. Welcome to the world of devops practice, it is going to be an exciting journey. You can impact hugely to your organization. The tools listed here are just for the start, pick and choose them according to your needs. Devops is not about these tools but they are very valuable in reaching where you want to go. They are neither necessary nor sufficient for a good devops practice, anyone telling otherwise is lying.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=808fc8a0c4eb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/pyankit/tools-for-achieving-devops-goals-808fc8a0c4eb">Tools for achieving devOps goals</a> was originally published in <a href="https://medium.com/pyankit">pyankit</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to start contributing to open source]]></title>
            <link>https://medium.com/pyankit/how-to-start-contributing-to-open-source-557e503930b3?source=rss----8dc00b20aa90---4</link>
            <guid isPermaLink="false">https://medium.com/p/557e503930b3</guid>
            <category><![CDATA[contributor]]></category>
            <category><![CDATA[community]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[free]]></category>
            <category><![CDATA[open-source]]></category>
            <dc:creator><![CDATA[Ankit Mittal]]></dc:creator>
            <pubDate>Tue, 28 Nov 2017 00:33:26 GMT</pubDate>
            <atom:updated>2017-11-28T00:33:15.887Z</atom:updated>
            <content:encoded><![CDATA[<p>I have been working as programmer for more than half a decade now, yet my open source contributions to established projects have been nil. Although, I do have bunch of repositories on my GitHub which are authored by me and have an Open License attached to them, but these are far from becoming mainstream.</p><p>Contributing to established projects have been on the back of the mind but these projects seem to work like magic all the times. Where is the place to add your contribution? If you also think like that, read on as I am sharing the first step I took in contributing back to OSS. This blog is for you, like me have been believing that there are super smart folks out there who make these cool libraries everyone uses and common folks like us are the consumers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vLtFVPTHJGDfw3XOl4C1Sw.jpeg" /></figure><p>It is true that the thought of contributing back is overwhelming, because how to find what to contribute. Things just work and things to work on are getting thinner and thinner. This is the first myth, I had to quash in my mind. Technology inherently needs smart humans even to maintain the status quo. It needs effort to stay at the same level. This is called operational overload. Any technology, which is working will not keep up on its own. Take example of cars, infrastructure, application production systems, every piece has its operational overload. On quashing this myth we establish rule 1 of OSS contribution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o1fGjwyaAMzd_z1Ep6EGaQ.jpeg" /><figcaption><strong>No technology can upkeep itself, it needs technologists and technicians to stay healthy.</strong></figcaption></figure><p>Now, when you have decided to contribute to OSS. Next step is to choose a project. I find the following guidelines work really well for first few times.</p><ol><li>Choose a project with your comfortable language or tech stack. Doesnt have to be complete familiarity, but a common ground will help</li><li>Choose a project that is frequently updated, check for latest bugs quashed or PRs merged.</li><li>Has a beginner contributor guidelines, contributors are friendly to n00b-ish questions.</li><li>Gauge the turn around time of the maintainers. This is a contentious rule, not everyone will agree to it. However, I believe this is going to be very helpful for a beginner. Most maintainers are hard working and are always in clutch of time. But for someone who needs to start venturing into OSS from a consumer (user) to a producer (contributor), a week’s turn around time or more is not going to be helpful. You will need 3–4 rounds of back and forth discussions before your changes are merged. If they happen faster, the better. An unfortunate consequence to this will be more of us contributing to those projects which have dedicated teams working on it backed by big companies.</li></ol><p>Shortlisting at least 3 projects which fit this criteria.</p><p>Next question is Who to ask help for? It is a good idea to spend some time in reading up on conversations either on the comments on bug tracker or google group or a real time chat. Most projects have major contributors present on either of the three channels.</p><p>Also, some times good projects have this information on contributing guidelines itself. While you are pondering this, keep in mind that the project is much more than the codebase. It is a community, a documentation, set of tutorials/knowhow, a way of moving forward with the project (how does contributors make decisions, choose direction, choose priorities etc). Everything comes as bundled up with the project. As a corollary, much of the problems of open source communities are related to documentation, tests, test plans, communication, tutorials, technical know hows. Trust in a open source project is a function of all these <em>fringe elements. </em>Code is small part of making open source a success and you can add a lot of value to it by contributing on the fringes. This is a good opportunity as well, you can contribute not only to the core but also to the fringes.</p><blockquote><a href="https://github.com/spinnaker/deck/pull/4161/files">https://github.com/spinnaker/deck/pull/4161/files</a> This is my first Pull request to an established project — spinnaker. It is one liner tooltip change. The story behind this request is related to a task I was doing at my work. I had to copy a pipeline in spinnaker and make minor changes to it. The seemingly simple task took me half a day because I misunderstood something. After talking to experts I figured out how to do the task. I created this small PR to avoid this confusion for everyone else. The maintainers were super quick, and my changes were merged into the master in 2 days. This gave me a super confidence boost. Now I can think of contributing in a bigger way.</blockquote><p><strong>Look for fringes, lack of documentation, tests, tutorials, technical knowhow, how to guides and translations. Not only they are a good start but also they add a lot of value to the community.</strong></p><p>Next Steps: You have identified few projects, then sent a PR for review to one of them on documentation. Did this few times and have some visibility in the community. Now what.</p><p>A good next step is to help the maintainers, since being an OSS maintainer is one of the hard jobs in the software world, that too an unpaid one (except few). There are few ways to do it, catch hold of newly reported bugs, reproduce them, write test cases that fail. Solving it will need deeper knowledge but this is going to reduce the burden significantly. Also look at translations if you know few more languages than the maintainers.</p><p>Closing thoughts: Contributing to OSS as a habit is hard, you are basically using your ‘me time’ or ‘family time’ for this. Yet, contributing to OSS is really addictive and it feels good.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_o81YbJg_qxXhHaZFWiWhQ.jpeg" /></figure><p>PS: There is a growing trend of including OSS contributions in hiring decisions, that sucks. Read <a href="https://storify.com/trodrigues/why-i-don-t-like-open-source-a-play-in-3-acts">https://storify.com/trodrigues/why-i-don-t-like-open-source-a-play-in-3-acts</a> for why that is bad.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=557e503930b3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/pyankit/how-to-start-contributing-to-open-source-557e503930b3">How to start contributing to open source</a> was originally published in <a href="https://medium.com/pyankit">pyankit</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Convolution Neural Networks using Tensorflow]]></title>
            <link>https://medium.com/pyankit/convolution-neural-networks-using-tensorflow-a78d60c1a0ac?source=rss----8dc00b20aa90---4</link>
            <guid isPermaLink="false">https://medium.com/p/a78d60c1a0ac</guid>
            <category><![CDATA[classification]]></category>
            <category><![CDATA[tensorflow]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Ankit Mittal]]></dc:creator>
            <pubDate>Mon, 27 Nov 2017 07:04:29 GMT</pubDate>
            <atom:updated>2017-11-27T18:47:33.296Z</atom:updated>
            <content:encoded><![CDATA[<p>I played around with CIFAR10 dataset and documenting here, going from 63% test accuracy to a little under 80%</p><p>Dataset — It consists of 60k images in 10 classes. The dataset is perfectly balanced with 6k images per class. 50k of these are in training dataset and 10k in test dataset. The goal of this exercise was to build a model, feed images to it to train and check how good the model is on test data.</p><p>These are the classes and some sample images.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/1*GQ-AJKP9OBeSgAW4s_LHtQ.png" /></figure><p>Thinking about the problem, first step was to look for inspiration which I found in LeNet architecture applied on MNIST. That looked like a good starting point. Here is a <a href="https://sumitbinnani.github.io/CarND-LeNet-Lab/">refresher</a> for a basic LeNet.</p><p><strong>LeNet Architecture:</strong></p><ol><li>Convolution layer, with reLU and 2x2 max pooling, with 32 filters</li><li>Another convolution layer with reLU and 2x2 max pooling, with 64 filters.</li><li>Fully Connected layer with 1025 neurons, dropout with 0.5 keep probability.</li><li>Another FC layer with 10 outputs this time.</li></ol><p>This straight out of the box CNN, gives 66% accuracy on test set. Not bad at all. Lets try to improve it.</p><pre># Helper functions, for instantiating layers. Will be used across all architectures</pre><pre><strong>def</strong> weight_variable(shape):<br>    <strong>return</strong> tf.Variable(tf.truncated_normal(shape, stddev=0.1))<br><br><strong>def</strong> bias_variable(shape):<br>    <strong>return</strong> tf.Variable(tf.constant(0.1, shape=shape))<br><br><strong>def</strong> conv2d(x,W):<br>    <strong>return</strong> tf.nn.conv2d(x,W,strides=[1,1,1,1], padding=&#39;SAME&#39;)<br><br><strong>def</strong> max_pool(x):<br>    <strong>return</strong> tf.nn.max_pool(x, ksize=[1,2,2,1],<br>                          strides=[1,2,2,1], padding=&#39;SAME&#39;)<br><br><strong>def</strong> conv_layer(input, shape):<br>    W = weight_variable(shape)<br>    b = bias_variable([shape[3]])<br>    <strong>return</strong> tf.nn.relu(conv2d(input, W) + b)<br><br><strong>def</strong> full_layer(input, size):<br>    in_size = int(input.get_shape()[1])<br>    W = weight_variable([in_size, size])<br>    b = bias_variable([size])<br>    <strong>return</strong> tf.add(tf.matmul(input, W), b)</pre><pre>x = tf.placeholder(tf.float32, [<strong>None</strong>, 32, 32, 3])<br>y = tf.placeholder(tf.float32, [<strong>None</strong>, 10])<br>keep_prob = tf.placeholder(tf.float32)<br><br>conv1 = max_pool(conv_layer(x, shape=[5,5,3,32]))<br>conv2 = max_pool(conv_layer(conv1, shape=[5,5,32,64]))<br>conv2_flat = tf.reshape(conv2, [-1, 8*8*64])<br><br>full_1 = tf.nn.relu(full_layer(conv2_flat, 1024))<br>full_1_dropout = tf.nn.dropout(full_1, keep_prob=keep_prob)<br><br>y_conv = full_layer(full_1, 10)<br><br><em>#training</em><br>cross_entropy = tf.losses.softmax_cross_entropy(y, y_conv)<br>optimizer = tf.train.AdamOptimizer(0.0001).minimize(cross_entropy)<br><br>accuracy = tf.reduce_mean(<br>    tf.cast(<br>        tf.equal(<br>            tf.argmax(y, 1),<br>            tf.argmax(y_conv, 1),<br>        ),<br>        tf.float32,<br>    ),<br>)*100</pre><p>LeNet Code</p><pre>MINI_BATCH_SIZE=512<br>STEPS = 55000</pre><pre><strong>with</strong> tf.Session() <strong>as</strong> sess:<br>    sess.run(tf.global_variables_initializer())<br>    <br>    <strong>for</strong> step <strong>in</strong> range(STEPS):<br>        batch = cifar.train.next_batch(MINI_BATCH_SIZE)<br>        sess.run(optimizer, feed_dict={<br>            x:batch[0], y:batch[1], keep_prob:0.5<br>        })<br>        <br>        <strong>if</strong> step%500 == 0:<br>            acc = sess.run(accuracy, feed_dict={<br>                x:batch[0], y:batch[1], keep_prob:1.0<br>            })<br>            print(&quot;Train loss accuracy for step <strong>{}</strong> is <strong>{}</strong>&quot;.format(step,acc))<br>        <br>        <br>    test_x = cifar.test.images.reshape(10,1000,32,32,3)<br>    test_y = cifar.test.labels.reshape(10,1000, 10)<br>    accuracy = np.mean([sess.run(accuracy, feed_dict={<br>        x:test_x[i], y:test_y[i], keep_prob:1.0<br>    }) <strong>for</strong> i <strong>in</strong> range(10)])<br>    print(&quot;Accuracy is <strong>{}</strong>&quot;.format(accuracy))</pre><p>In the next step, I added one more layer of convolutions before fully connected with 128 filters.</p><p>This took the test accuracy straight to 73%. Not bad, lets continue.</p><p>Next, I tried to remove the max pool completely from all the convolutions layer. This did not help and reduced the accuracy back to 66%. Ofcourse, max pooling is there for a reason.</p><pre>MINI_BATCH_SIZE=512<br>STEPS = 60000<br>cifar = CifarDataManager()<br><br>x = tf.placeholder(tf.float32, [<strong>None</strong>, 32, 32, 3])<br>y = tf.placeholder(tf.float32, [<strong>None</strong>, 10])<br>keep_prob = tf.placeholder(tf.float32)<br><br>conv1 = max_pool(conv_layer(x, shape=[5,5,3,32]))<br>conv2 = max_pool(conv_layer(conv1, shape=[5,5,32,64]))<br>conv3 = max_pool(conv_layer(conv2, shape=[5,5,64,128]))<br>conv3_flat = tf.reshape(conv3, [-1, 4*4*128])<br>conv3_drop = tf.nn.dropout(conv3_flat, keep_prob=keep_prob)<br><br>full_1 = tf.nn.relu(full_layer(conv3_drop, 1024))<br>full_1_dropout = tf.nn.dropout(full_1, keep_prob=keep_prob)<br><br>y_conv = full_layer(full_1, 10)<br><br><em>#training</em><br>cross_entropy = tf.losses.softmax_cross_entropy(y, y_conv)<br>optimizer = tf.train.AdamOptimizer(0.0001).minimize(cross_entropy)<br><br>accuracy = tf.reduce_mean(<br>    tf.cast(<br>        tf.equal(<br>            tf.argmax(y, 1),<br>            tf.argmax(y_conv, 1),<br>        ),<br>        tf.float32,<br>    ),<br>)*100<br><br><strong>with</strong> tf.Session() <strong>as</strong> sess:<br>    sess.run(tf.global_variables_initializer())<br>    <br>    <strong>for</strong> step <strong>in</strong> range(STEPS):<br>        batch = cifar.train.next_batch(MINI_BATCH_SIZE)<br>        sess.run(optimizer, feed_dict={<br>            x:batch[0], y:batch[1], keep_prob:0.5<br>        })<br>        <br>        <strong>if</strong> step%1000 == 0:<br>            acc = sess.run(accuracy, feed_dict={<br>                x:batch[0], y:batch[1], keep_prob:1.0<br>            })<br>            print(&quot;Train loss accuracy for step <strong>{}</strong> is <strong>{}</strong>&quot;.format(step,acc))<br>        <br>        <br>    test_x = cifar.test.images.reshape(10,1000,32,32,3)<br>    test_y = cifar.test.labels.reshape(10,1000, 10)<br>    accuracy = np.mean([sess.run(accuracy, feed_dict={<br>        x:test_x[i], y:test_y[i], keep_prob:1.0<br>    }) <strong>for</strong> i <strong>in</strong> range(10)])<br>    print(&quot;Accuracy is <strong>{}</strong>&quot;.format(accuracy))</pre><p>Next, I checked out a completely different CNN topology which came after LeNet. This is called AlexNet and came from G. Hinton’s lab in Toronto. This was a groundbreaking paper in 2012 when it shattered the Imagenet records from 36% error rate to 16%. The difference from leNet was instead of using single convolution layer and then immediately use a max_pooling layer, use stacks of convolution layers as a block and then max pool.</p><p>So changing the three Convolution layers in the previous architecture, to blocks of convolutions with each block containing 3 convolution layers, dropout and maxpooling. This takes a bit longer to run than previous topologies. (2 hours on azure NC6 instance, with K80 GPU). I used, Deep Learning Virtual Machine on Azure for training this. This jumped up the test accuracy from 73% previously to 79.8%, a good steep jump.</p><pre>MINI_BATCH_SIZE=512<br>STEPS = 50000<br><strong>from</strong> <strong>random</strong> <strong>import</strong> randint<br><br><strong>def</strong> conv_layer(input, shape):<br>    W = weight_variable(shape)<br>    b = bias_variable([shape[3]])<br>    <strong>return</strong> tf.nn.relu(conv2d(input, W) + b)<br><br>x = tf.placeholder(tf.float32, [<strong>None</strong>, 32, 32, 3])<br>y = tf.placeholder(tf.float32, [<strong>None</strong>, 10])<br>keep_prob = tf.placeholder(tf.float32)<br><br>conv1_1 = conv_layer(x, shape=[3, 3, 3, 30])<br>conv1_2 = conv_layer(conv1_1, shape=[3, 3, 30, 30])<br>conv1_pool = max_pool(conv_layer(conv1_2, shape=[3, 3, 30, 30]))<br>conv1_drop = tf.nn.dropout(conv1_pool, keep_prob=keep_prob)<br><br>conv2_1 = conv_layer(conv1_drop, shape=[3, 3, 30, 50])<br>conv2_2 = conv_layer(conv2_1, shape=[3, 3, 50, 50])<br>conv2_pool = max_pool(conv_layer(conv2_2, shape=[3, 3, 50, 50]))<br>conv2_drop = tf.nn.dropout(conv2_pool, keep_prob=keep_prob)<br><br>conv3_1 = conv_layer(conv2_drop, shape=[3, 3, 50, 80])<br>conv3_2 = conv_layer(conv3_1, shape=[3, 3, 80, 80])<br>conv3_pool = tf.nn.max_pool(<br>    conv_layer(conv3_2, shape=[3, 3, 80, 80]), <br>    ksize=[1, 8, 8, 1], <br>    strides=[1, 8, 8, 1], <br>    padding=&#39;SAME&#39;,<br>)<br>conv3_flat = tf.reshape(conv3_pool, [-1, 80])<br>conv3_drop = tf.nn.dropout(conv3_flat, keep_prob=keep_prob)<br><br>full1 = tf.nn.relu(full_layer(conv3_flat, 500))<br>full1_drop = tf.nn.dropout(full1, keep_prob=keep_prob)<br>y_conv = full_layer(full1_drop, 10)<br><br>optimizer = tf.train.AdamOptimizer(0.0001).minimize(<br>    tf.losses.softmax_cross_entropy(y, y_conv)<br>)<br><br>accuracy = tf.reduce_mean(<br>    tf.cast(<br>        tf.equal(<br>            tf.argmax(y, 1),<br>            tf.argmax(y_conv, 1),<br>        ),<br>        tf.float32,<br>    ),<br>)*100<br><br>test_x = cifar.test.images.reshape(10,1000,32,32,3)<br>test_y = cifar.test.labels.reshape(10,1000, 10)<br><br><strong>with</strong> tf.Session() <strong>as</strong> sess:<br>    sess.run(tf.global_variables_initializer())<br>    <br>    <strong>for</strong> step <strong>in</strong> range(STEPS):<br>        batch = cifar.train.next_batch(MINI_BATCH_SIZE)<br>        sess.run(optimizer, feed_dict={<br>            x:batch[0], y:batch[1], keep_prob:0.75<br>        })<br>        <br>        <strong>if</strong> step%1000 == 0:<br>            train_accuracy = round(sess.run(accuracy, feed_dict={<br>                x:batch[0], y:batch[1], keep_prob:1.0<br>            }), 2)<br>            <br>            i = randint(0,9)<br>            test_accuracy = round(sess.run(accuracy, feed_dict={<br>                x:test_x[i], y:test_y[i], keep_prob:1.0<br>            }), 2)<br>            <br>            print(&quot;Step <strong>{}</strong>: Train accuracy is <strong>{:.2f}</strong>, test accuracy is <strong>{:.2f}</strong>&quot;.format(<br>                step,<br>                train_accuracy,<br>                test_accuracy,<br>            ))<br>        <br>        <br>    print(&quot;--------------------------------------&quot;)<br>    print(&quot;---------------------------------------&quot;)<br>    accuracy = np.mean([sess.run(accuracy, feed_dict={<br>        x:test_x[i], y:test_y[i], keep_prob:1.0<br>    }) <strong>for</strong> i <strong>in</strong> range(10)])<br>    print(&quot;Final Accuracy is <strong>{}</strong>&quot;.format(accuracy))</pre><p>Here is the link to all the code — <a href="https://github.com/ankitml/tensorflow-exercises/blob/master/CIFARCNN.ipynb">https://github.com/ankitml/tensorflow-exercises/blob/master/CIFARCNN.ipynb</a></p><p>PS: State of the art for CIFAR10 is 96.5%, published in 2015. <a href="https://www.dropbox.com/s/k7l05ywbdqemt2u/Screenshot%202017-11-27%2000.49.00.png?dl=0">Here is the leaderboard</a> for CIFAR10.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mEjxplpEUMPRthDzjXYZcQ.png" /><figcaption>Top published results for CIFAR 10. Found <a href="https://www.dropbox.com/s/k7l05ywbdqemt2u/Screenshot%202017-11-27%2000.49.00.png?dl=0">here</a>.</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a78d60c1a0ac" width="1" height="1" alt=""><hr><p><a href="https://medium.com/pyankit/convolution-neural-networks-using-tensorflow-a78d60c1a0ac">Convolution Neural Networks using Tensorflow</a> was originally published in <a href="https://medium.com/pyankit">pyankit</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[“Fault” vs “Failure” and fault tolerant systems]]></title>
            <link>https://medium.com/pyankit/fault-vs-failure-and-fault-tolerant-systems-60ec7dbfbe0d?source=rss----8dc00b20aa90---4</link>
            <guid isPermaLink="false">https://medium.com/p/60ec7dbfbe0d</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[qa]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[distributed-systems]]></category>
            <category><![CDATA[test]]></category>
            <dc:creator><![CDATA[Ankit Mittal]]></dc:creator>
            <pubDate>Sun, 24 Sep 2017 23:40:34 GMT</pubDate>
            <atom:updated>2017-11-28T00:35:24.322Z</atom:updated>
            <content:encoded><![CDATA[<p>Fault vs failure is one of those concepts which is well understood in theory classes but hard to grasp in the real world. Especially when in the real world teams are siloed into a horizontal and vertical matrix.</p><p>In simple terms : <strong>Fault</strong> is when a component of a system deviates from its spec, <strong>Failure</strong> is when a system doesn’t provide its service to the user or provides an unacceptably degraded service.</p><p>In an ideal world, there are no faults but in real world faults will be there but failure is still unacceptable. Imagine if railway switch doesn’t get triggered on time because garbage collector had paused the thread*. Systems that can cope up with large number of the possible defects are called <strong>fault tolerant systems</strong>. Although, this name is misleading because a system can guarantee tolerating only known faults not all possible ones. <em>In other terminologies, failure would be a bug and a fault would be just a defect</em>.<br>For keeping a system fault tolerant today’s software teams have two hard problems, classifying faults which are a failure and containing faults to avoid becoming failures.</p><ul><li>For the first problem, the easiest solution is to have someone from the engineering team understand the business or have product (business) and engineering teams have very cohesive communication. If there is a seperate QA team, it becomes utmost important for this team to classify a bug and a defect. Good QA teams get this bug classification right.</li><li>For the second problem, there is no easy fix. It involves careful deliberation on how the various components of the system interact with each other, assumptions different components have regarding the others, thorough testing of “fault lines” ie areas of high coupling or areas where assumptions mismatch, measuring and monitoring each component. Regular retrospective analysis and proactive audits are a few good ways to keep an eye on evolving system.</li><li>Apart from this prevention first approach, another important step in making systems fault tolerant is making each component recover fast from faults. For this approach, every component has to be rollbackable (ie have ability of rollback to its previous non-faulty state), and the system need to detect fault fast and trigger the rollback to self correct itself.</li></ul><p>What I have seen in recent years, is that it is becoming hard to catch the faults by automated tests (unit, integration and E2Es) as the system grows in number of components. Following these three strategies and developing processes around them helps in building fault tolerant systems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vwpKuuN6GjA7FjDaATLNHQ.jpeg" /><figcaption>Fault vs Failure</figcaption></figure><p>*This is a hypothetical scenario, in the real world such switches will not be using common Linux and will have much higher guarantees from the OS and the compilers.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=60ec7dbfbe0d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/pyankit/fault-vs-failure-and-fault-tolerant-systems-60ec7dbfbe0d">“Fault” vs “Failure” and fault tolerant systems</a> was originally published in <a href="https://medium.com/pyankit">pyankit</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Notes from functions17 conf in Toronto]]></title>
            <link>https://medium.com/pyankit/notes-from-functions17-conf-in-toronto-f40ca767389?source=rss----8dc00b20aa90---4</link>
            <guid isPermaLink="false">https://medium.com/p/f40ca767389</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[cloud-functions]]></category>
            <dc:creator><![CDATA[Ankit Mittal]]></dc:creator>
            <pubDate>Sun, 24 Sep 2017 23:40:24 GMT</pubDate>
            <atom:updated>2017-08-26T03:48:26.668Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Notes from functions17 conf in Toronto</strong></p><p>IBM cloud has support for open source apache open whisk. which aims to be could provider independent serverless framework. Will keep an eye on their progress.</p><ol><li>Google’s firebase functions are in beta and hence by design do not provide any SLA for any serious work.</li><li>Azure does not have mac support yet. The workflow is bundled with VSCode IDE and the whole microsoft developer ecosystem. However during the talk I was able to set up a hello world kind of simple function. (Hodor as a service) from their in browser-editor. Doesnt feel like production ready, more of a demoable small stuff. THey have another service called Logic App, which sounded like they are trying to emulate something like zapier and integrate it with custom functions.</li><li>AWS had by far the most mature understanding of functions and their customer needs. Unsurprising. Talk from their side was not really a demo or small tutorial of their system but how 12 factor app is still relevant in the serverless world (Except 4.5 out of 12 points) and by designing functions properly the guidelines can help designing the system.</li><li>Pivotal folks were demoing a bleeding edge of their open source work on “<a href="https://www.gitbook.com/book/ankitml/journal/edit#">bosh</a>”. They are doing some kickass work on abstracting out cloud providers so you can switch them easily for running serverless. Although their demo of java/spring functions went above my head.</li><li>Overall, it was very evident that most work in serverless world is done by node folks and they have the best tooling so far. To actually use the cutting edge functions infra or tools, I may have to drop pip install for a while and do a npm install.</li><li>One of the interesting talks was by the Keynote Kassandra Perch from IoPipe, and her experience of using lambda with longboard. She had set up a contraption with her longboard that when it crashes, her pendent would shine or something and she has to press a button in 10 seconds else her room mate will get a panic email (through a serverless function hosted on AWS lambda). iopipe seems to be working on interesting problem of application monitoring, tracing on lambda functions in production. They recently launched a feature where you can see how much time your code took line by line. Can be interesting to see how this works because in my opinion this should not be needed. All the business code and actual work should be abstracted out in the external libraries. Actual aws lambda code just need to be like a view in MVC.. very thin. IN any case building tools for serverless functions is hard because the vendors are in a flux, so kudos to them.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f40ca767389" width="1" height="1" alt=""><hr><p><a href="https://medium.com/pyankit/notes-from-functions17-conf-in-toronto-f40ca767389">Notes from functions17 conf in Toronto</a> was originally published in <a href="https://medium.com/pyankit">pyankit</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Transitioning to python3.5 in MacOS]]></title>
            <link>https://medium.com/pyankit/transitioning-to-python3-5-in-macos-db0cabd20809?source=rss----8dc00b20aa90---4</link>
            <guid isPermaLink="false">https://medium.com/p/db0cabd20809</guid>
            <category><![CDATA[python2-vs-python3]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[transitions]]></category>
            <category><![CDATA[python3]]></category>
            <dc:creator><![CDATA[Ankit Mittal]]></dc:creator>
            <pubDate>Sun, 28 Aug 2016 16:14:24 GMT</pubDate>
            <atom:updated>2016-08-28T16:14:23.922Z</atom:updated>
            <content:encoded><![CDATA[<p>I have completely shifted to python3, apart from some ad hoc scripts that are used rarely. Surprisingly my transition (and our <a href="http://www.upgrad.com/">company’s</a> full codebase) was smoother and easier than what I expected. There was no critical third party library that we were using and did not support python3. There were one odd easily replaceable Django apps which were kicked out without any trouble.</p><p>When we made this decision of transition there were multiple apprehensions, fears as python3 was sort of a completely unknown territory. The easiest way to kill those fears were to face them, ie install python3 on my development machine and try to play around with this. Try to use python3 with our python projects and sort of see how deep troubles are.</p><p>There are small differences in the way you can set up python dev environment for python3.5 compared to python2.7. If you are still on python2.7 just follow these 5 steps (with a broadband, should take less than 20 minutes) to get a working python3 environment on mac.</p><p><strong>Step 1</strong>: Make sure you have generic utilities on mac — Homebrew, zsh (or any advanced shell), xcode command line utilities.</p><p><strong>Step 2</strong>: Install python3.5 from <a href="https://www.python.org/downloads/">python.org</a>. Do not make python3.5 as default python on your machine. Since that is the default version shipped with mac, I suggest you keep it that way. Also, There might be some applications which depend on python2.7 implicitly.Once you do this, running python on your terminal will still open old python. To run python 3.5 shell or any script use command `python3`.</p><p><strong>Step 3</strong>: Installing a package manager — pip works fine for most purposes. However, if you have much of the data sciency work, look out for Anaconda. Coming back to pip, you don’t need to install pip as it gets shipped with python3.5. However, you may have to upgrade it to a newer version to get rid of an annoying warning message.</p><p><strong>Step 4</strong>: Installing virtualenv — Good news, you wont even need to install virtualenv. Python3.5 ships out with a command line utility called `pyvenv`, which you can use to create virtual environments for your machine. If you are not using virtual environments, I would really encourage you for using them as you will not have to bother switching between py2/py3 as, if you have a virtual environment created from py3, `python` keyword would mean python3 when that virtualenv is activated.</p><p><strong>Step 5</strong>: Your python 3 setup is ready. Go fire up you IDE/vi or whatever and start kicking ass.</p><p><em>The road to python3 is much less tricky than what it seems.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=db0cabd20809" width="1" height="1" alt=""><hr><p><a href="https://medium.com/pyankit/transitioning-to-python3-5-in-macos-db0cabd20809">Transitioning to python3.5 in MacOS</a> was originally published in <a href="https://medium.com/pyankit">pyankit</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My development Environment]]></title>
            <link>https://medium.com/pyankit/my-development-environment-60abf7435cce?source=rss----8dc00b20aa90---4</link>
            <guid isPermaLink="false">https://medium.com/p/60abf7435cce</guid>
            <category><![CDATA[environment]]></category>
            <category><![CDATA[setup]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[vim]]></category>
            <dc:creator><![CDATA[Ankit Mittal]]></dc:creator>
            <pubDate>Tue, 23 Aug 2016 06:35:00 GMT</pubDate>
            <atom:updated>2016-08-23T06:35:00.496Z</atom:updated>
            <content:encoded><![CDATA[<p>I work at UpGrad, an ed-tech company working on empowering every individual to their full professional potential. My main techstack here is python 3.5, Django 1.9 and some number crunching using numpy.</p><p>For the development hardware : I mainly use my work laptop which is a macbook pro-retine. For my personal projects I have a mac mini at home.</p><p><strong>Software</strong></p><p><strong>Shell</strong>: ZSH with Oh-my-zsh activated. I am actively using these pluigns — git, git-flow, brew, github, zsh-completions, zsh-syntax-highlighting, common-aliases, sublime, web-search, history-substring-search. Auto completion and color highlighting in commands itself is enough benefit of using zsh.</p><p><strong>Editor</strong>: VIM. I have been using VIM for almost 4 years now and .vimrc is highly customized. I use tmux for terminal management as vim and tmux play nicely together. This is my <a href="https://github.com/ankitml/scripts/blob/master/zsh/vimrc">.vimrc</a>. I have tried switching to pycharm and sublime sometime back but somehow I end up returning back to trusted old vim.</p><p>When not doing web development work, Jupyter notebook is a great environment to work with ad hoc scripts as well as number crunching.</p><p>A nice, and comfortable development environment can increase you productivity by many folds. Keep iterating, removing bottlenecks and automate grunt work</p><p><strong>Some non dev related tools</strong> :</p><p>For communication, we are using slack at work. Also I have a personal slack team which me and some of my friends are using to share what we learned on machine learning. It is sort of a tight-knit community focuessed on self paced learning in Data Science.</p><p>For all the notes, I am using Microsoft Onenote. It has decent web client as well as desktop clients.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=60abf7435cce" width="1" height="1" alt=""><hr><p><a href="https://medium.com/pyankit/my-development-environment-60abf7435cce">My development Environment</a> was originally published in <a href="https://medium.com/pyankit">pyankit</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[8 stackoverflow threads to read for deeper understanding of Python]]></title>
            <link>https://medium.com/pyankit/8-stackoverflow-threads-to-read-for-deeper-understanding-of-python-327586bcb303?source=rss----8dc00b20aa90---4</link>
            <guid isPermaLink="false">https://medium.com/p/327586bcb303</guid>
            <category><![CDATA[expert]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[stackoverflow]]></category>
            <dc:creator><![CDATA[Ankit Mittal]]></dc:creator>
            <pubDate>Sun, 14 Aug 2016 14:02:36 GMT</pubDate>
            <atom:updated>2016-08-14T14:18:47.116Z</atom:updated>
            <cc:license>https://creativecommons.org/licenses/by-sa/4.0/</cc:license>
            <content:encoded><![CDATA[<p>Stackoverflow is a great resource for beginners of programming. But what is underestimated is, the quality content on the site for intermediate programmers. Here I list down few suchquestions, which have helped me immensely in advancing my python learning journey beyond the basics.</p><ol><li><a href="http://stackoverflow.com/q/21553327/1620792">Except:pass</a> — Catching any exception and not doing anything, is used as an escape mechanism when you dont know how your try: block will work. However, any experienced pythonista will get irritated on seeing it. Delve deeper into this stackoverflow thread to know so.</li><li><a href="http://stackoverflow.com/q/3277367/1620792">Super() in multiple inheritance</a> — Understadning the behaviour of super is straight forward in case of single inheritance. Since python is one of those languages that support multiple inheritance, the world of Super() gets a bit murky.</li><li><a href="http://stackoverflow.com/q/739654/1620792">Demystifying decorators</a> — Decorators are immensely useful for adding common functionality to functions. Read this thread thoroughly to know what lies beyond simple and straight forward uses of decorators.</li><li><a href="http://stackoverflow.com/q/2709821/1620792">Understanding self</a> — <em>explicit is better than implicit</em>. An explicit self doesnt feature in any of the other OOP languages.</li><li><a href="http://stackoverflow.com/q/1132941/1620792">Mutable default argument</a> — This is one of the places where every python beginner gets stumped, twice.</li><li><a href="http://stackoverflow.com/q/36901/1620792">*, ** unpacking operators</a> — Although much of the functionality is new in python3.5. * and ** have been there since python2 inside function arguments.</li><li><a href="http://stackoverflow.com/q/100003/1620792">MetaClasses</a> — Just like objects are instances of classes, classes are themselves <em>first class objects</em>, ie instances of special set of classes called metaclass.</li><li><a href="http://stackoverflow.com/q/1301346/1620792">Single and double underscores in naming</a> — Also called <em>dunder, </em>double underscores as prefix and suffix have special meaning in python. e.g. __init__, __str__, unlike single underscore as prefix like _pvt_var, which is a signal for private-ness of the name/method.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=327586bcb303" width="1" height="1" alt=""><hr><p><a href="https://medium.com/pyankit/8-stackoverflow-threads-to-read-for-deeper-understanding-of-python-327586bcb303">8 stackoverflow threads to read for deeper understanding of Python</a> was originally published in <a href="https://medium.com/pyankit">pyankit</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>