Skip to content

Instantly share code, notes, and snippets.

View pabloem's full-sized avatar
🐢

Pablo pabloem

🐢
  • Seattle, WA
View GitHub Profile
@pabloem
pabloem / __init__.py
Created March 3, 2016 02:14
Code for perceptron
# We need this to initialize python packages
@pabloem
pabloem / AMC_homework2.m
Last active August 29, 2015 14:22
Homework #2 of Advanced Programing Methodology at SNU
%STABILITY OF QR
N = 100;
C = [];
S0 = []; S1 = []; S2 = []; T0 = []; T1 = []; T2 = [];
for k = 1:N
c = 10^(10*rand); C = [C c];
% Create m by n (m >= n) matrix with condition number c
m = 1 + round(100*rand);
n = min(1+round(m*rand),m);
A = givcond(m,n,c);
@pabloem
pabloem / count_squares.m
Created April 23, 2015 12:44
ML homework 3
%###################################################################
% Homework #3. Number of features in a 24x24 pixel image
% Student: Pablo J. Estrada. ID: 2014-25245
%###################################################################
% Here are our patterns. We need only specify their dimensions.
patt_x = [2,1,2,3,1]
patt_y = [1,2,2,1,3]
function res = count(x, y, patt_len,patt_x,patt_y)
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
#pragma once
#pragma warning(push)
#pragma warning(disable:4996)
#include <cassert>
#include <memory>
#include <vector>
@pabloem
pabloem / endian_bug.c
Last active December 17, 2015 20:19
Sample code for endianness bug
void print_variable(char *variable)
{
printf("Variable is %d\n",*variable);
}
int main()
{
int variable = 1;
print_variable(&variable);
}