Skip to content

Instantly share code, notes, and snippets.

View pabloem's full-sized avatar
🐢

Pablo pabloem

🐢
  • Seattle, WA
View GitHub Profile
@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);
}
#pragma once
#pragma warning(push)
#pragma warning(disable:4996)
#include <cassert>
#include <memory>
#include <vector>
# ~/.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
@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)
@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 / __init__.py
Created March 3, 2016 02:14
Code for perceptron
# We need this to initialize python packages
#!/usr/bin/env python3
import sys
import json
import pickle
def decode(dic, bitstr):
res = []
length = bitstr.bit_length() - 1
if bitstr >> length != 1:
import subprocess
tables = [
"Dictionary_codi",
"Dictionary_item",
"NFC_hits",
"album",
"apply",
"banner",
"board_comment",
@pabloem
pabloem / README.md
Created July 29, 2016 02:48
Problema de LNPP

.

## -*- coding: utf-8 -*-
import json
import sys
import time
import apache_beam as beam
from apache_beam.io.fileio import CompressionTypes as ct
from apache_beam.utils.options import PipelineOptions
from beam_utils.sources import CsvFileSource