brew install redis
Set up launchctl to auto start redis
$ ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents
/usr/local/opt/redis/
is a symlink to /usr/local/Cellar/redis/x.y.z
(e.g., 2.8.7
)
#!/usr/bin/env ruby | |
# | |
# Mac fix 1 - Install the Nokogiri gem on Mac OS 10.9 Mavericks | |
# | |
# Usage: to configure and install using Bundler, pass in 'bundle' as an argument to the script. | |
# | |
# Nokogiri works at a very low level, so it has many issues on various platforms. | |
# As a result, the command `install gem nokogiri` often will fail. This fix is for | |
# errors involving 'libiconv', such as the following one I encountered: | |
# |
import numpy as np | |
class Data_generator(object): | |
def __init__(self,K,d,reward_type='binary'): | |
self.d = d # dimension of the feature vector | |
self.K = K # number of bandits | |
self.reward_type = reward_type |
#chat-box.ubuntu.hidden-xs | |
.closed | |
.pull-right | |
= link_to_function content_tag(:i, nil, class: 'glyphicon glyphicon-chevron-up').html_safe, 'chat.show()' | |
.m-l-small | |
= link_to_function 'Chat with us', 'chat.show()' | |
.opened{style: 'display: none'} | |
.header | |
.pull-right | |
= link_to_function content_tag(:i, nil, class: 'glyphicon glyphicon-plus-sign').html_safe, 'chat.maximize()', class: 'maximize', style: 'display: none' |
#Non-mathematical Introductions
#Videos
class YourNamespace.Errors | |
window.onerror = (e) => @report(e) | |
@report: (e) -> | |
img = new Image(1,1) | |
img.src = '//' + your_config.errors_host + '/images/error_pixel.gif' | |
img.style.display='none' | |
document.getElementsByTagName('body')[0].appendChild(img); |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<title>Single-Column Responsive Email Template</title> | |
<style> | |
@media only screen and (min-device-width: 541px) { | |
.content { |
function[binary_codes,G_vecs] = WTA_kernel_binary(X,G_vecs,G, K) | |
% G is number of permutation vectors | |
% K is the insterest span | |
if size(G_vecs,1) == 0 | |
G_vec = zeros(G,size(X,2)); | |
for i = 1:G | |
G_vecs(i,:) = randperm(size(X,2),size(X,2)); | |
end | |
end |
R is like:
from numpy import * | |
from scipy.stats import beta | |
import random | |
class BetaBandit(object): | |
def __init__(self, num_options=2, prior=None): | |
self.trials = zeros(shape=(num_options,), dtype=int) | |
self.successes = zeros(shape=(num_options,), dtype=int) | |
self.num_options = num_options |