Skip to content

Instantly share code, notes, and snippets.

View byronyi's full-sized avatar
:octocat:
Just for fun

Bairen Yi byronyi

:octocat:
Just for fun
View GitHub Profile
/*
* Space complexity: O(1); Time complexity: O(n).
*/
void reverseString(char* str){
if(str == NULL) return; // Validation checking.
if(*str == "\0") return; // Empty string.
char temp; // For swapping tail and head.
char* head=str, tail=str; // Pointers for the beginning and the end of the string.
@byronyi
byronyi / matplotlibrc
Last active August 29, 2015 14:08 — forked from huyng/matplotlibrc
### MATPLOTLIBRC FORMAT
# This is a sample matplotlib configuration file - you can find a copy
# of it on your system in
# site-packages/matplotlib/mpl-data/matplotlibrc. If you edit it
# there, please note that it will be overridden in your next install.
# If you want to keep a permanent local copy that will not be
# over-written, place it in HOME/.matplotlib/matplotlibrc (unix/linux
# like systems) and C:\Documents and Settings\yourname\.matplotlib
# (win32 systems).
# Author: Vlad Niculae <vlad@vene.ro>
# Licence: BSD
from __future__ import division, print_function
import numpy as np
from sklearn.utils import check_random_state
class SquaredLoss(object):
def loss(self, y, pred):
Gartner:
https://www.gartner.com/doc/2867017/-planning-guide-overview-architecting
https://www.gartner.com/doc/2929317/framework-evaluating-big-data-initiatives
https://www.gartner.com/doc/2773117/security-futures-plan-peak-threat
https://www.gartner.com/doc/2691917/big-data-needs-datacentric-security
https://www.gartner.com/doc/2621115/big-data-analytics-requires-ethical
Books and Training:
http://www.amazon.com/Data-Science-Big-Analytics-Discovering/dp/111887613X
http://www.kaggle.com/competitions#getting-started
@byronyi
byronyi / iunzip.py
Last active August 29, 2015 14:22 — forked from andrix/iunzip.py
import itertools
from operator import itemgetter
def iunzip(iterable):
"""Iunzip is the same as zip(*iter) but returns iterators, instead of
expand the iterator. Mostly used for large sequence"""
_tmp, iterable = itertools.tee(iterable, 2)
iters = itertools.tee(iterable, len(_tmp.next()))
return (itertools.imap(itemgetter(i), it) for i, it in enumerate(iters))
@byronyi
byronyi / zmqstub.c
Created February 8, 2016 11:23 — forked from HarryR/zmqstub.c
zmq & libevent stub
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <libgen.h>
#include <signal.h>
#include <err.h>
#include <assert.h>
#include <zmq.h>
@byronyi
byronyi / System Design.md
Created April 18, 2016 07:10 — forked from vasanthk/System Design.md
System Design Cheatsheet

#System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

##Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@byronyi
byronyi / soft-iwarp.adoc
Created May 11, 2016 15:30 — forked from jasonbrooks/soft-iwarp.adoc
Toward a method of testing Gluster RDMA with regular ethernet NICs, for the hardware-challenged. For now, I have the installing soft-iwarp on Fedora 18 part down (I think). Up next, the getting it to work with Gluster RDMA part...

Testing Gluster RDMA with Soft-iWARP

There’s a Gluster 3.4 RDMA test day right around the corner, and I want to join in on the fun. The trouble is, I don’t have any RDMA-capable hardware in my lab right now. Undaunted, I hit the Web in search of a software-based solution, one that would at least allow me to run through the tests.

I found a pair of promising-looking options:

The information out on the web about these projects is a bit thinner than I’d like, but I found a blog post howto on installing Soft-iWARP on Ubuntu 10.10 and another for Debian 6 and figured I’d try it out on Fedora 18.

@byronyi
byronyi / latency.txt
Created November 19, 2016 08:21 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@byronyi
byronyi / local_distributed_benchmark.py
Created June 12, 2017 05:57 — forked from yaroslavvb/local_distributed_benchmark.py
Benchmark distributed tensorflow locally by adding vector of ones on worker2 to variable on worker1 as fast as possible
"""Benchmark tensorflow distributed by adding vector of ones on worker2
to variable on worker1 as fast as possible.
On 2014 macbook, TensorFlow 0.10 this shows
Local rate: 2175.28 MB per second
Distributed rate: 107.13 MB per second
"""