Skip to content

Instantly share code, notes, and snippets.

View BinRoot's full-sized avatar

Nishant Shukla BinRoot

View GitHub Profile
import tensorflow as tf
# We’ll use NumPy matrices in TensorFlow
import numpy as np
# Define a 2x2 matrix in 3 different ways
m1 = [[1.0, 2.0],
[3.0, 4.0]]
m2 = np.array([[1.0, 2.0],
[3.0, 4.0]], dtype=np.float32)
m3 = tf.constant([[1.0, 2.0],
import numpy as np
revenue = np.dot(prices, amounts)
@BinRoot
BinRoot / ch02_1.py
Last active November 3, 2016 14:34
revenue = 0
for price, amount in zip(prices, amounts):
revenue += price * amount
A breakthrough in artificial intelligence will tell us a lot about ourselves--
what it means to be human, and what it means to think or whether thought is observable,
and if so, can it be traced it to an inspiration.
@BinRoot
BinRoot / download.sh
Last active January 1, 2016 14:19
Haskell implementation of Norvig's simplified algorithm to autocorrect a spelling mistake
#!/bin/bash
# download the code
wget https://gist.github.com/BinRoot/8157165/raw/9109a51173b76c4e233fd00165fb25e62b249aa5/spell.hs
# download big.txt
wget http://norvig.com/big.txt
# run the code
runhaskell spell
@BinRoot
BinRoot / realnumber.quote
Created December 26, 2013 18:08
Real Numbers
The
real number system
is that
unique
algebraic structure
represented by
all
Dedekind-complete ordered fields.
- Eric Schechter
@BinRoot
BinRoot / zshot.sh
Created December 21, 2013 19:56
This script allows you the change the destination and name of your screenshots right after hitting printscreen. Bind your printscreen key to this script.
#!/bin/bash
# zshot allows you to easily change the filename and destination of each screenshot
# Dependencies: scrot, zenity
cd ~
if [ ! -d "Pictures" ]
then mkdir ~/Pictures
fi
@BinRoot
BinRoot / punctuation.hs
Last active December 31, 2015 17:09
Remove punctuation from a string
clean :: String -> String
clean = foldr (.) id $ map (flip replace "") ["!", "\"", "#", "$", "%", "(", ")", ".", ",", "?"]
Ars longa, vita brevis
Airplanes don’t flap their wings; why should computers think?