sudo apt-get update
sudo apt-get upgrade
sudo apt-get install python-virtualenv
sudo virtualenv /opt/myenv
sudo apt-get update | |
sudo apt-get install -y git-core build-essential libssl-dev libboost-all-dev libdb5.1-dev libdb5.1++-dev libgtk2.0-dev | |
git clone https://github.com/bitcoin/bitcoin.git | |
cd bitcoin/src | |
make -f makefile.unix clean; make -f makefile.unix USE_UPNP= bitcoind | |
spam_train, ham_train, spam_test, ham_test = ['train/spam', 'train/ham', 'test/spam', 'test/ham'].map{|t| Dir["#{ARGV[0]}/#{t}/*"].map {|fn| File.open(fn, 'r:iso8859-1').read.gsub(/[^a-zA-Z]/, ' ').split}} | |
spam_log, ham_log = [spam_train, ham_train].map{|t| t.flatten.instance_eval {reduce(Hash.new(0)) { |h,v| h[v] += 1.0/size; h }.select{|w, v| w.size > 2 && v > 8e-6}}.instance_eval{each {|k,v| self[k] = Math.log(v)}}} | |
spam_predict, ham_predict = [spam_test, ham_test].map {|t| t.map{|d| [spam_log, ham_log].map {|log| d.reduce(0){|s, w| log[w] ? s + log[w] : s}}}} | |
p spam_predict.size, spam_predict.select{|e| e.first < e.last}.size | |
p ham_predict.size, ham_predict.select{|e| e.first > e.last}.size |
gsl_rng_env_setup(); | |
gsl_rng* rng = gsl_rng_alloc(gsl_rng_default); | |
sqlite3* db = 0; | |
int h[0x10000]; | |
int kc[0x100]; | |
float kmean[0x100]; | |
uint16_t tbl[0x10000]; | |
int i; | |
for (i = 0; i < 0x10000; i++) | |
tbl[i] = i; |
// Copyright 2013 Google Inc. All Rights Reserved. | |
// | |
// Licensed under the Apache License, Version 2.0 (the "License"); | |
// you may not use this file except in compliance with the License. | |
// You may obtain a copy of the License at | |
// | |
// http://www.apache.org/licenses/LICENSE-2.0 | |
// | |
// Unless required by applicable law or agreed to in writing, software | |
// distributed under the License is distributed on an "AS IS" BASIS, |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# This is a simplified implementation of the LSTM language model (by Graham Neubig) | |
# | |
# LSTM Neural Networks for Language Modeling | |
# Martin Sundermeyer, Ralf Schlüter, Hermann Ney | |
# InterSpeech 2012 | |
# | |
# The structure of the model is extremely simple. At every time step we |
# 1. Make sure you have nginx sub module compiled in | |
# nginx -V 2>&1 | grep --color=always '\-\-with\-http_sub_module' | |
# 2. add two directives below at HTTP level | |
# nginx.conf | |
http { | |
# ...... | |
sub_filter '</head>' '<style type="text/css">html{ filter: progid:DXImageTransform.Microsoft.BasicImage(grayscale=1); -webkit-filter: grayscale(100%); filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale"); /* Firefox 10+, Firefox on Android */ |
--- | |
layout: default | |
--- | |
<div class="blog-index"> | |
{% assign post = site.posts.first %} | |
{% assign content = post.content %} | |
{% include post_detail.html %} | |
</div> |
A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."