apt-get update && apt-get dist-upgrade
apt-get install open-vm-tools # VMware VMs Only
sh -c 'echo vm.swappiness=5 > /etc/sysctl.conf' # Prod Env
rebootSome of these packages may already be installed
| http { | |
| ... | |
| proxy_cache_path /data/perch.squaremill.com/shared/image_cache levels=1:2 keys_zone=images:10m; | |
| ... | |
| } |
| ''' | |
| Non-parametric computation of entropy and mutual-information | |
| Adapted by G Varoquaux for code created by R Brette, itself | |
| from several papers (see in the code). | |
| This code is maintained at https://github.com/mutualinfo/mutual_info | |
| Please download the latest code there, to have improvements and | |
| bug fixes. |
if you are using linux, unix, os x:
pip install -U setuptools
pip install -U pip
pip install numpy
pip install scipy
pip install matplotlib
#pip install PySide
| from collections import defaultdict | |
| import re | |
| import numpy as np | |
| from sklearn.datasets import fetch_20newsgroups | |
| from sklearn.feature_extraction import FeatureHasher | |
| from sklearn.linear_model.stochastic_gradient import SGDClassifier | |
| from sklearn.externals import joblib | |
| def tokens(doc): |
| VERSION=0.20.6 | |
| sudo apt-get update | |
| sudo apt-get install openjdk-6-jdk | |
| wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-$VERSION.deb | |
| sudo dpkg -i elasticsearch-$VERSION.deb | |
| # be sure you add "action.disable_delete_all_indices" : true to the config!! |
| # Example usage: | |
| require 'active_record/nonpersisted_attribute_methods' | |
| class Node < ActiveRecord::Base | |
| include ActiveRecord::NonPersistedAttributeMethods | |
| define_nonpersisted_attribute_methods [:bar] | |
| # Example of using with ancestry and getting :parent to show up in changes hash. | |
| has_ancestry | |
| define_nonpersisted_attribute_methods [:parent] |
| The command you ran: | |
| $ rails runner ';' | |
| Exception backtrace(s), if any: (warnings, in this case) | |
| /Users/peeja/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/x86_64-darwin11.2.0/psych.bundle: warning: already initialized constant ANY | |
| /Users/peeja/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/x86_64-darwin11.2.0/psych.bundle: warning: already initialized constant UTF8 | |
| /Users/peeja/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/x86_64-darwin11.2.0/psych.bundle: warning: already initialized constant UTF16LE | |
| /Users/peeja/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/x86_64-darwin11.2.0/psych.bundle: warning: already initialized constant UTF16BE | |
| /Users/peeja/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/x86_64-darwin11.2.0/psych.bundle: warning: already initialized constant ANY | |
| /Users/peeja/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/x86_64-darwin11.2.0/psych.bundle: warning: already initialized constant UTF8 |
| # Weighted Moving Average (WMA) | |
| # http://en.wikipedia.org/wiki/Moving_average#Weighted_moving_average | |
| # | |
| # Given a hash, calculates the weighted moving averages of its values within | |
| # a window size given. Modifies the original hash values. | |
| # | |
| # @param hash [Hash] the hash for whom values calculate the weighted moving | |
| # averages. | |
| # @param maws [Fixnum] the Moving Average Window Size. The greatest this | |
| # number is the smoothest the calculated averages will be. |