Skip to content

Instantly share code, notes, and snippets.

View EpiphanyMachine's full-sized avatar

Gregory Hilkert EpiphanyMachine

View GitHub Profile
features = [] # make new empty list
counter = 0
for row in train:
# for row in range(len(train)-1): # for every row in the data
# print row
# data we need to create features
# items needed to test questions
# PANDAS USAGE
question_tokens = nltk.word_tokenize(row[0]) # all tokens (words, punc, etc)
question_tags = nltk.pos_tag(question_tokens) # all tokens and parts of speech in lists
var paths = function (n) {
var time = new Date();
var board = [];
for (var i = 0; i < n; i++) {
board.push([]);
for (var j = 0; j < n; j++) {
board[i].push(0);
}
}
board[0][0] = 1;
@EpiphanyMachine
EpiphanyMachine / Balanced Parentheses Prompt
Last active December 26, 2015 06:09
Algorithms Meetup 21 Oct 13
#
# write a function that takes a string of text and returns true if
# the parentheses, brackets, and braces are balanced and false otherwise.
#
# Example:
# balanceParens('[](){}'); // true
# balanceParens('[({})]'); // true
# balanceParens('[(]{)}'); // false
#
# Step 3:
var dict = require('dictionary');
var solveJumble = function (string) {
'use strict';
var originalBag = string.split('');
var anagrams = [];
var findAnagrams = function (bag, word) {
var tempBag, tempWord;
for (var i = 0; i < bag.length; i++) {
tempBag = bag.slice();
@EpiphanyMachine
EpiphanyMachine / JS Solution
Created December 4, 2013 03:00
Basic Dijkstra's Algorithm (assume same edge weights) https://www.youtube.com/watch?v=gdmfOwyQlcI
// thanks to:
// Adam - https://github.com/acreeger
// Juan - https://github.com/nilnullzip
// Note that I decided the search order heuristic should be based solely on the person being visited
// and the goal person. The position within the graph should not be considered, so the graph edges
// are not annotated. Rather a heuristic function is used that takes as input only two people. I believe
// this makes more sense if the heuristic is based on things like number of friends or similarity in
// things like: school, city, job, etc.
function toRoman(number) {
'use strict';
var v = [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1], // set values
r = [ 'M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I'], // set numerals
n = Math.round(number), // clean number, round to nearest integer
limit = 3999, // set max limit to check integers against
s = '', // create empty string for numerals
val; // create temp val variable
// check if number is greater than the limit

Keybase proof

I hereby claim:

  • I am EpiphanyMachine on github.
  • I am ghilkert (https://keybase.io/ghilkert) on keybase.
  • I have a public key whose fingerprint is 73FB 620A D527 AB3A AEE5 C58E 2F61 C35A 4201 2521

To claim this, I am signing this object:

@EpiphanyMachine
EpiphanyMachine / pia-iptm
Created April 26, 2015 00:57
PIA Iptables Manager v0.5
#!/bin/bash
# PIA Iptables Manager
# Version 0.5
# Modified by: EpiphanyMachine@gmail.com
# Originally Created by ShadowSpectre <shadowspectre@tormail.org>
# https://www.privateinternetaccess.com/forum/discussion/1151/pia-iptables-manager-new
clear
echo ".: PIA Iptables Manager v0.4 :."
@EpiphanyMachine
EpiphanyMachine / index.js
Last active November 9, 2023 15:28
npx node script
#!/usr/bin/env node
console.log("Hello");