Skip to content

Instantly share code, notes, and snippets.

View de-sh's full-sized avatar

Devdutt Shenoi de-sh

View GitHub Profile
@de-sh
de-sh / RustyBeginnings.md
Created March 17, 2020 11:25
Rust ELI5?

Rusty Beginnings

Hey there, so you wanna become a rustacean? I see you are interested in rust-lang and want to understand the madness behind the magic that makes it a safe, speedy and concurrent language to write software in. So it's always safe to understand why you should learn it in the first place, lemme give you a quick pitch!

Why learn rust?

Rust is the language of the next 40 years, don't take my word for it, check out the talk! It is built to alleviate a problem that ~99% of all software developers face when writiing low-level and performant code. But it is also being developed to scratch common itches and unsafe programming practices, such as building in a Garbage Collector to manage memory, which languages such as Python and Golang do!

Rust-lang on the other hand manages memory by making use of a complex borrow-checker mechanism that does it by following your commands as given in the program. This is also done at compile time, so you do

@de-sh
de-sh / rust_from_python.md
Last active September 4, 2019 09:58
Lets rust your python :D

Backstory

I have been learning rust for quite some time now and its structuring as a language is pretty funny. The promises are themselves a huge undertaking for the project. But for me, I have been interested, because of one simple reason, its fool-proofness.

"Fool proof?" you might ask, well yes! The language is practically an interesting take on the challenge to build a systems-level/C-type alternative to... well, C(C++ also kinda makes it into that category, but that debate is for another day). I have been into rust officially, for around 3 months now and it is interesting how easy it is to get tired and kick yourself out of learning it.

I think that is exactly why I am writing this log, because I want to share an interesting find I had while learning for myself. To take you back into the reasoning behind this post, I have been understanding the basics of this language with help from exercism, a language learning platform, akin to duolingo, but for pr

@de-sh
de-sh / FOSSMeet_Hydra.md
Last active April 2, 2019 13:49
A summary of the talk on Hydra by me at FOSSMeet'19
Hydranian logo

FOSSMeet is an annual conference held by the FOSS Cell of National Institute of Technology - Calicut, Kozhikode. This year I got the opportunity to speak at this prestigious conference, a first for me. The talk was on an interesting development in the Web Technologies sphere, especially relating to the field of APIs. Here is a basic overview of what I covered and a few points I'd like to express over here.

What's wrong with the APIs of now?

Application Programming Interfaces are all the rage within the modern world of micro-services and IoT. We live in a world where there are APIs that do vairous tasks, be it an NLP service that summarises or even those that provide images of random cuteness to fill up your website.

@de-sh
de-sh / file.css
Created January 11, 2019 19:38
Requisite CSS
body {
font: 16px/1.618 "Roboto", sans-serif;
}
header {
color: #2661a9;
z-index: 999;
flex-grow: 1;
box-shadow: 0px 2px 4px -1px rgba(0, 0, 0, 0.2),
0px 4px 5px 0px rgba(0, 0, 0, 0.14), 0px 1px 10px 0px rgba(0, 0, 0, 0.12);
@de-sh
de-sh / file.html
Created January 11, 2019 19:37
This will take styles later
<header>
<div class="holder">
<div class="col-centred">
<img class="logo" src="./img/IEEEMEC-Final.png" alt="IEEE SB | MEC">
</div>
<div class="col-centred">
<h1>IEEE Student Branch</h1>
<h2>Govt. Model Engineering College, Kochi</h2>
</div>
<div class="col-centred">
@de-sh
de-sh / start-hugo.md
Created December 26, 2018 13:10
A brief on how I built my blog and the theme that styles it

So, I made a promise on Twitter to restart my blog. Almost a year since I uploaded content on my self hosted blog, I had already deleted content(accidentally) off of it 😂. Its embarassing, saying that you blog and not having any proof to say you really do, all because you did not save the content from your last venture. Leaving all of that aside, I did what best I could to make sure

@de-sh
de-sh / installing-pip.md
Last active December 26, 2018 13:02
I have had a tough time installiing stuff from PyPi... No more

So, have you been in the situation where you are not any more new to python, building stuff is easy, but not quite up to your expectations...

Then you end up discoverng the beautiful Python Package Index, and you just fall in love with how easy it is to install all kinds of packages, be it Django, Flask or even TensorFlow! Well, that's exactly the situation I was in after 4 years of using python!

I have installed pip and done many wonderful things with it... That is until I found out that I was doing things the wrong way.

Installing pip with get-pip.py was easy, but it also was not the correct way, the way I now prefer and adhere to... I hope you don't make the same mistake, so I bring to you, this pretty short gist of what I have learnt from my experience with PIP, and python packages in general!

Installing pip

@de-sh
de-sh / TryOut.md
Last active November 4, 2017 04:16
A question to try out your skills by coding example problems.

A collection of Python questions to begin problem solving

  1. Make use of Python functions to build a list of objects(numbers and strings) input by the user as a string consisting of 'comma'(",") seperated values. 4 marks.

Bonus convert string to int if value is a number. 2 marks

  1. Make a string containing the roll number, name and unique 3 digit number input as lists each containing number(roll), string(name) and tuple(UID) 6 marks.

  2. Write a Python function to print the contents of a list into a file as a string of values seperated by comma. Use str() to convert non string values to string. 4 marks.

import numpy as np
from sklearn import datasets, linear_model
import matplotlib.pyplot as plt
class Config:
nn_input_dim = 2 # input layer dimensionality
nn_output_dim = 2 # output layer dimensionality
# Gradient descent parameters (I picked these by hand)
epsilon = 0.01 # learning rate for gradient descent
import numpy as np
from sklearn import datasets, linear_model
import matplotlib.pyplot as plt
def generate_data():
np.random.seed(0)
X, y = datasets.make_moons(200, noise=0.20)
return X, y
def visualize(X, y, clf):