Skip to content

Instantly share code, notes, and snippets.

View eggie5's full-sized avatar
💭
Working on TensorFlow Ranking

Alex Egg eggie5

💭
Working on TensorFlow Ranking
View GitHub Profile
@eggie5
eggie5 / interpolate.m
Created September 15, 2013 05:21
working 0 padded interpolation
function [y, indexy] = myinterpolate(x, N, a_x, b_x)
a=a_x;
b=b_x;
x_axis=a:b;
x_axis_exp=a:length(x_axis)*N;
x_axis_norm=1:length(x_axis_exp);
y=[];
indexy=[];
@eggie5
eggie5 / development.log
Created July 8, 2013 03:46
why is my log like this? how can I get the controller and AR details back?
=> Booting WEBrick
=> Rails 3.2.12 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2013-07-07 20:44:19] INFO WEBrick 1.3.1
[2013-07-07 20:44:19] INFO ruby 1.9.2 (2011-07-09) [x86_64-darwin11.0.1]
[2013-07-07 20:44:19] INFO WEBrick::HTTPServer#start: pid=67911 port=3000
Started GET "/contracts/77/edit" for 127.0.0.1 at 2013-07-07 20:44:23 -0700
@eggie5
eggie5 / regf.v
Created April 27, 2013 03:42
pipelined mips register file (w/ structural hazard fix)
module reg_file
#(parameter addWidth=5, dataWidth=32)
(data_out_1, data_out_2, addr_1, addr_2,
addr_3, data_in_3, clk, we3);
input [addWidth-1:0] addr_1, addr_2, addr_3;
input [dataWidth-1:0] data_in_3;
input clk;
input we3;
output [dataWidth-1:0] data_out_1, data_out_2;
w = logspace(-1,5,50);
for i = 1:length(w)
if (w(i) <= 36)
magn(i) = 20*log10(w(i)) + 20*log10(92)
elseif (w(i) <= 1800)
magn(i) = 20*log10(w(i)) + 20*log10(92) -20*log10(w(i)/36)
elseif (w(i) <=100000)
magn(i) = 20*log10(w(i)) + 20*log10(92) -20*log10(w(i)/36) -20*log10(w(i)/1800)
else
# Helps visualize the steps of Viterbi.
def print_dptable(V):
print "",
for i in range(len(V)): print "%7d" % i,
print
for y in V[0].keys():
print "%.5s: " % y,
for t in range(len(V)):
print "%.7s" % ("%f" % V[t][y]),
input clk, reset,
input [5:0] Opcode, Funct,
input zero,
output reg MemToReg,
output reg RegDst,
output reg IorD,
output reg PCSrc,
output reg ALUSrcA,
output reg [1:0] ALUSrcB,
output reg IRWrite,
module FSM
(input clk, input RESET, input din, output pe);
//state declartion
reg [1:0] state_reg, next_state; //2 bits for 3 states - not one-hot encoding
parameter zero=0;
parameter one=1;
parameter _edge=2;
#!/usr/bin/env python
## WARNING: This file is generated
#!/usr/bin/env python
"""Create a "virtual" Python installation
"""
# If you change the version here, change it in setup.py
# and docs/conf.py as well.
__version__ = "1.7.2" # following best practices
virtualenv_version = __version__ # legacy, again
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
#include <stdio.h>
int main( int argc, char *argv[])
{
int i;
int max=atoi( argv[1] );
printf("generating primes up to %d\n",max);
int nums[max];