Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍🔬

Pedro Rodriguez EntilZha

👨‍🔬
View GitHub Profile
View gist:dcea1ad24d126105d9c3
if [[ ! -f "/opt/graphite/bin/carbon-cache.py" ]]; then
wget -qNP /tmp https://github.com/downloads/graphite-project/whisper/whisper-0.9.10.tar.gz
tar -C /tmp -zxf /tmp/whisper-0.9.10.tar.gz
cd /tmp/whisper-0.9.10
python setup.py install
wget -qNP /tmp https://github.com/downloads/graphite-project/carbon/carbon-0.9.10.tar.gz
tar -C /tmp -zxf /tmp/carbon-0.9.10.tar.gz
cd /tmp/carbon-0.9.10
python setup.py install
View Graphlab, similar params to convergence
Topic 0: adhering(948), amplification(838), autonomous(766), bower(748), airborne(748), amplifying(738), bination(698), acl(695), buy(688), assume(663), acldey(658), bypass(657), account(653), appendix(641), busy(636),
Topic 1: aut(1107), biggest(1020), accents(1020), associative(955), barron(954), barrier(945), adap(927), austin(906), adam(906), aration(882), burges(806), affecting(801), affects(794), afferent(759), acyclic(757),
Topic 2: boser(876), apex(716), berlin(704), automaton(654), atypical(608), aliasing(608), ariaboost(585), barak(571), accumulated(559), attias(555), ang(531), antennas(525), antennae(516), annu(498), biological(490),
Topic 3: activating(1192), acceleration(836), accent(798), ary(794), bahl(792), brosch(791), acceptance(751), aggregate(707), blowfly(662), aggregation(648), beneath(635), bringing(630), benchmarks(623), backprop(617), caption(601),
Topic 4: arl(949), boot(907), baluja(884), carefully(769), capacitances(734), bonn(728), bfilthoff(720), ballard(704), buffer(690), carpen
@EntilZha
EntilZha / proposal.md
Last active Aug 29, 2015
Ampcrowd JS Template
View proposal.md

AMPCrowd Template Proposal

Task API

Task Group

  • group_id
  • tasks_finished
  • callback_url
  • group_context
  • crowd_config

Task

@EntilZha
EntilZha / main.rs
Created Oct 6, 2015
Rust code trying to implement the EM algorithm for a simple example
View main.rs
fn main() {
let observations = [5, 9, 8, 4, 7];
let (theta_a, theta_b) = em(0.5, 0.5, observations);
println!("ThetaA: {}, ThetaB: {}", theta_a, theta_b);
}
fn em(theta_a_0: f64, theta_b_0: f64, observations: [i32; 5]) -> (f64, f64) {
let mut theta_a = theta_a_0;
let mut theta_b = theta_b_0;
let a_probs = observations.iter().map(|x| binomial(theta_a, *x, 10));
@EntilZha
EntilZha / hashtable.py
Last active Mar 5, 2021
Hash Table (Open Address) implementation in Python practicing for interviews
View hashtable.py
from collections import namedtuple
TableEntry = namedtuple('Element', 'hash key value')
class HashTable(object):
DEFAULT_SIZE = 8
EMPTY_VALUE = TableEntry(None, None, None)
DELETED_VALUE = TableEntry(None, None, None)
LOAD_FACTOR = 2 / 3
MIN_FACTOR = 1 / 3
@EntilZha
EntilZha / Max Interval.ipynb
Created Nov 18, 2015
Max Interval Solution
View Max Interval.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View RDD.cpp
#include <iostream>
#include <vector>
using namespace std;
template <typename A>
class RDD {
public:
vector<A> sequence;
RDD(vector<A> sequence): sequence(sequence) {}
View graph.rs
use std::collections::HashMap;
#[derive(Debug)]
pub struct Graph<V: Copy, E: Copy> {
pub vertexes: HashMap<usize, Vertex<V>>,
pub edges: HashMap<(usize, usize), E>,
adjacency_matrix: Vec<Vec<bool>>
}
#[derive(Debug)]
View Cargo.toml
[package]
name = "ffitest"
version = "0.1.0"
authors = ["Pedro Rodriguez <ski.rodriguez@gmail.com>"]
[dependencies]
[lib]
name = "ffitest"
crate-type = ["dylib"]
View lib.rs
pub struct BfsIterator<'a, V: 'a + Copy, E: 'a + Copy> {
queue: VecDeque<VertexId>,
graph: &'a Graph<V, E>,
distances: Vec<u64>,
parents: Vec<VertexId>,
predicate: &'a Fn(V, E, V) -> bool
}
impl<'a, V: Copy, E: Copy> Graph<V, E> {
pub fn bfs_iter(&'a self, source: VertexId) -> BfsIterator<V, E> {