Skip to content

Instantly share code, notes, and snippets.

View EricZeiberg's full-sized avatar

Eric Zeiberg EricZeiberg

  • Boston, MA
View GitHub Profile
import os
import numpy as np
import tensorflow as tf
# Load them!
cwd = os.getcwd()
loadpath = cwd + "/processedData.npz"
l = np.load(loadpath)
# See what's in here
@EricZeiberg
EricZeiberg / train.py
Created November 8, 2015 20:10
Python script to calculate the effect of sleep on perceived effort on runs
from bs4 import BeautifulSoup, NavigableString, Tag
import numpy as np
from sklearn import cross_validation
from sklearn.linear_model import Ridge
def parseHTML(html):
scaleArray = []
sleepArray = []
soup = BeautifulSoup(html, "html.parser")
logs = soup.find_all("form")[0]
DefaultHttpClient httpclient = new DefaultHttpClient(new BasicHttpParams());
HttpPost httppost = new HttpPost(PARK_ENDPOINT);
// Depends on your web service
httppost.setHeader("Content-type", "application/json");
InputStream inputStream = null;
String result = null;
try {
HttpResponse response = httpclient.execute(httppost);
@EricZeiberg
EricZeiberg / Greedy BFS.java
Last active August 29, 2015 14:20
A Java implementation of Greedy Best-First-Search for HackerRank
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
public class Solution {
public static class Point {
private int x;
@EricZeiberg
EricZeiberg / Octokit issue
Created August 14, 2014 19:32
Octokit issue
def index
config = YAML.load_file("#{Rails.root}/config/github.yml")[Rails.env]
client = Octokit::Client.new(:access_token => "[REDACTED]")
user = client.user
user.login
Octokit.auto_paginate = true
repo = 'MasterEjay/Blog'
@name = 'Blog'
@desc = 'These are the latest changes to the blog'
unpaginated = client.commits(repo, :per_page => 10000)

Bot Rules

Hey guys, wanted to establish some guidelines so that this is no longer solely bots in the chat.

  • Bots may not send more messages than are directed to them. In the case of notifications, ie: twitter watching, github updates:
    • updates must not advertise a certain product, service, brand, or idea
    • updates must be less frequent than one per minute per topic
    • updates must not monitor more than 10 topics
  • Bots must have a unique prefix. Prefix "#" is reserved.
public Bot() {
this.setName("IRC-To-Skype");
}
public void onMessage(String channel, String sender,
String login, String hostname, String message) {
try{
Skype.chat("Bot eric.zeiberg").send("(" + sender + ") " + message);
}catch(SkypeException e){
e.printStackTrace();
package me.masterejay.gorobo;
import com.darkprograms.speech.microphone.MicrophoneAnalyzer;
import com.darkprograms.speech.recognizer.GoogleResponse;
import com.darkprograms.speech.recognizer.Recognizer;
import javax.sound.sampled.AudioFileFormat;
import java.io.File;
/**
package me.masterejay.gorobo;
import com.darkprograms.speech.microphone.Microphone;
import com.darkprograms.speech.microphone.MicrophoneAnalyzer;
import com.darkprograms.speech.recognizer.GoogleResponse;
import com.darkprograms.speech.recognizer.Recognizer;
import javaFlacEncoder.FLACFileWriter;
import javax.sound.sampled.AudioFileFormat;
import java.io.File;
package me.masterejay.gorobo;
import com.darkprograms.speech.microphone.Microphone;
import com.darkprograms.speech.microphone.MicrophoneAnalyzer;
import com.darkprograms.speech.recognizer.GoogleResponse;
import com.darkprograms.speech.recognizer.Recognizer;
import javaFlacEncoder.FLACFileWriter;
import javax.sound.sampled.AudioFileFormat;
import java.io.File;