Skip to content

Instantly share code, notes, and snippets.

View TrigonaMinima's full-sized avatar

Shivam Rana TrigonaMinima

View GitHub Profile
# http://signal-to-noise.xyz/post/bk-tree/
# to search nearest-neighbors of a query from the "metric space".
# distance should fulfill the 4 axioms of a metric.
from collections import deque
class BKTree:
def __init__(self, distance_func):
self._tree = None

Ask HN: What should I do with my old laptop?

  • Give it to someone
  • Put it on the wall near your door, and have it as a generic assistant. Put the days weather, your family calendar, time until next bus/train, news headlines, etc. on it. They should change at different periods of the day to give you time relevant information (e.g. I want to know the time until the next bus in the morning, but I don't care about this when I'm home in the evening).1
  • I had an old laptop I used to run Linux + Spotify on, so that I could take it to people's house parties and run music off it. No concerns about drink spillages or it being stolen, and you can let anyone add songs to the playlist. Warning: be selective over who you let near it.2
  • If it has an HDMI port, you can install Kodi on it and plug it to your TV to create a really cool media center.[3](https
@TrigonaMinima
TrigonaMinima / dfa.cpp
Last active September 7, 2015 21:46
Compiler Lab
// Deterministic Finite Automata
# include <iostream>
# include <fstream>
# include <vector>
# include <sstream>
# include <string>
# include <map>
using namespace std;
@TrigonaMinima
TrigonaMinima / .gitignore
Last active February 15, 2018 11:34
Shiny App.. wordcloud
*.png
rsconnect/*
@TrigonaMinima
TrigonaMinima / 01.md
Last active September 15, 2018 15:11
Jokes... [many are NSFW]

Here

One day a guy dies and finds himself in hell.
As he is wallowing in despair, he has his first meeting with the devil...
Satan: "Why so glum?"
Guy: "What do you think? I'm in hell!"
Satan: "Hell's not so bad. We actually have a lot of fun down here. You a drinking man?"
Guy: "Sure, I love to drink."
Satan: "Well, you're gonna love Mondays then. On Mondays, that's all we do, drink. Whiskey, tequila, Guinness, wine coolers, Tab, and Fresca. We drink 'til we throw up, and then we drink some more! And you don't have to worry about getting a hangover, because you're dead anyway."
Guy: "Gee that sounds great!"

### Title: Back to basics: High quality plots using base R graphics
### An interactive tutorial for the Davis R Users Group meeting on April 24, 2015
###
### Date created: 20150418
### Last updated: 20150423
###
### Author: Michael Koontz
### Email: [email protected]
### Twitter: @michaeljkoontz
###

This Gist contains a list of poems I like or want to read.