Skip to content

Instantly share code, notes, and snippets.

Edward Weng wengzilla

Block or report user

Report or block wengzilla

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View random_walk.rb
class RandomWalk
attr_accessor :outcome, :step_count
def initialize(upper_bound, lower_bound, step_size, win_probability)
@step_count = 0
@current_position = 0
@upper_bound = upper_bound
@lower_bound = lower_bound
@step_size = step_size
View keybase.md

Keybase proof

I hereby claim:

  • I am wengzilla on github.
  • I am wengzilla (https://keybase.io/wengzilla) on keybase.
  • I have a public key whose fingerprint is B3F1 4DE7 9F5D ADC7 94DE CAF0 B707 8861 2240 530D

To claim this, I am signing this object:

View links.txt
@wengzilla
wengzilla / concordance.java
Created Aug 7, 2014
Bug-free version of concordance.java
View concordance.java
public class Concordance {
public static void main(String[] args) {
System.out.println(args[0]);
In in = new In(args[0]);
String[] words = in.readAllStrings();
// String[] words = StdIn.readAll().split("\\s+");
// Not sure this is the intended behavior, I believe it's supposed to do the splitting on the input file.
ST<String, SET<Integer>> st = new ST<String, SET<Integer>>();
for (int i = 0; i < words.length; i++)
{
@wengzilla
wengzilla / template.html
Created Mar 22, 2014
Templating AngularJS App
View template.html
<html ng-app="TemplateApp">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"></script>
</head>
<body>
<div ng-controller="TemplateController">
<h1>Input</h1>
<div id="templateInputs">
View gist:8570574
package main
import (
"crypto/sha1"
"fmt"
"io"
"bytes"
"os"
"bufio"
"os/exec"
@wengzilla
wengzilla / wheel_of_fortune.rb
Created Jan 6, 2014
Wheel of Fortune analysis of Bonus Round answers.
View wheel_of_fortune.rb
require 'nokogiri'
require 'open-uri'
class Analyzer
attr_accessor :frequency_table
def initialize
@frequency_table = Hash.new(0)
end
@wengzilla
wengzilla / gist:7000289
Created Oct 15, 2013
Ruby script to download SSL certificates for Windows machines.
View gist:7000289
# Script written by Fletcher Nichol (fnichol)
require 'net/http'
# create a path to the file "C:\RailsInstaller\cacert.pem"
cacert_file = File.join(%w{c: RailsInstaller cacert.pem})
Net::HTTP.start("curl.haxx.se") do |http|
resp = http.get("/ca/cacert.pem")
if resp.code == "200"
@wengzilla
wengzilla / du.ino
Created Sep 15, 2013
Arduino file for dino 0.10.0 gem.
View du.ino
#include <Servo.h>
bool debug = false;
int index = 0;
char messageBuffer[12];
char cmd[3];
char pin[3];
char val[4];
View shipping.rb
require 'yaml'
file_data = YAML.load_file('shipping.yaml')
class ShippingData
def initialize(attr={})
@sd_data = attr
end
You can’t perform that action at this time.