Skip to content

Instantly share code, notes, and snippets.

View ggauravr's full-sized avatar

Gaurav Ramesh ggauravr

  • OpenTable
  • San Francisco
View GitHub Profile
@ggauravr
ggauravr / iris_plot.py
Last active December 27, 2015 03:48
this code demonstrates and describes basic visualization(2 out of four features) of the Iris Dataset, provided in the sklearn package.
from matplotlib import pyplot as plt
from sklearn.datasets import load_iris
import numpy as np
# load the dataset to be used
iris = load_iris()
# get the 150*4 features into varibale features
features = iris.data
(function() {
'use strict';
console.log(typeof someVariable); // prints "undefined"
console.log(typeof anotherVariable); // also prints "undefined"
var someVariable;
var anotherVariable = "Defined";
})();
(function() {
'use strict';
var someVariable = undefined;
var anotherVariable = undefined;
console.log(typeof someVariable); // prints "undefined"
console.log(typeof anotherVariable); // also prints "undefined"
anotherVariable = "Defined";
(function() {
'use strict';
console.log(typeof someVariable); // ReferenceError!
let someVariable = "Defined";
})();
@ggauravr
ggauravr / undeclared-typeof.js
Last active January 21, 2016 23:52
typeof with undeclared variable
(function() {
'use strict';
console.log(typeof someVariable); // prints "undefined"
})();
(function() {
'use strict';
let someVariable; // not even initialized to undefined, FTW !!
console.log(typeof someVariable); // ReferenceError
someVariable = "Defined";
})();
@ggauravr
ggauravr / popular-movies-2015-imdb.js
Last active February 21, 2016 21:14
Most Popular Hollywood Movies of 2015 from IMDb
@ggauravr
ggauravr / top-grossers-2015.js
Last active February 21, 2016 21:21
A list of top 100 grossers of 2015
var titleLinks = document.querySelectorAll('table a[href^="/movies/?id"]'),
titleArray = Array.prototype.slice.call(titleLinks),
titles = titleArray.map(function(link) {
return link.innerText + '@' + link.href;
});
// titles is an array like this:
// ["Star Wars: The Force Awakens@http://www.boxofficemojo.com/movies/?id=starwars7.htm",
// "Jurassic World@http://www.boxofficemojo.com/movies/?id=jurassicpark4.htm",
// "Avengers: Age of Ultron@http://www.boxofficemojo.com/movies/?id=avengers2.htm",
ModuleParseError: Module parse failed: /Users/gramesh/Documents/projects/start-page-nodejs/restaurant-profile/src/components/button/index.js Unexpected token (6:4)
You may need an appropriate loader to handle this file type.
| export default function Button(props) {
| return (
| <button type='button' className={styles.button}>{props.children}</button>
| );
| }
babelrc
{
@ggauravr
ggauravr / ai.conundrum.md
Created September 23, 2017 08:20
The AI Conundrum

The past few months have been a roller coaster ride for the field of Artificial Intelligence. The field that aims to marginally replicate human intelligence, has met the critical eye of many experts in the field of technology. With the likes of Stephen Hawking, Elon Musk and Mark Zuckerberg making statements about the inception of artificial intelligence in real life and its far fetched visions, the subject has to be a talk of the technology world. A few incidences in the research work carried out in various organizations like Facebook have also added to the ripples to the already unstable discussions of AI.

All these discussions have created a confusion in the minds of a few common people, about the field in general. These are the people who will be directly affected , if AI surfaces out in real life. As an enthusiast in the field, I felt the need to express my thoughts on the entire discussion. The ideas mentioned below are correct to my knowledge. In case of any discrepancy please feel