Skip to content

Instantly share code, notes, and snippets.

View de-sh's full-sized avatar
🦀
Rustacean from Kerala

Devdutt Shenoi de-sh

🦀
Rustacean from Kerala
View GitHub Profile
@de-sh
de-sh / Run.py
Last active October 2, 2017 13:29
Python working
def volCy():
r = int(input("Radius: "))
h = int(input("Height: "))
V = 3.1415*(r**2)*h
print("The volume is ",V)
def surSp():
r = int(input("Radius: "))
A = 3.1415*4*(r**2)
print("The surface area is ",A)
@de-sh
de-sh / nn_from_scratch.py
Created October 6, 2017 09:59
Doing a neural network
# %% 1
# Package imports
import matplotlib.pyplot as plt
import numpy as np
import sklearn
import sklearn.datasets
import sklearn.linear_model
import matplotlib
# Display plots inline and change default figure size
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):
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
@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.

@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 / 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 / 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 / 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 / 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.