This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def trunc(x) | |
(x * 100.0).floor / 100.0 | |
end | |
output = File.open("bestfit2.txt", "w") | |
count, point_count, points, = nil, nil, nil | |
IO.readlines("bestfit.txt").each do |line| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install build-essential ruby1.9.1 php5-cli mono-complete mono-vbnc nodejs-legacy openjdk-7-jdk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo apt-get -y install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev autoconf libc6-dev libncurses5-dev automake libtool bison subversion | |
$ wget http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz | |
$ tar xvf yaml-0.1.4.tar.gz | |
$ cd yaml-0.1.4 | |
$ ./configure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bry@linode:~$ ab -n 1000 -c 20 http://pd.bryanbibat.net/ | |
This is ApacheBench, Version 2.3 <$Revision: 655654 $> | |
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ | |
Licensed to The Apache Software Foundation, http://www.apache.org/ | |
Benchmarking pd.bryanbibat.net (be patient) | |
Completed 100 requests | |
Completed 200 requests | |
Completed 300 requests | |
Completed 400 requests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bry-temp@webgeek:~# ab -n 1000 -c 20 http://webgeek.ph/devcup/ | |
This is ApacheBench, Version 2.3 <$Revision: 655654 $> | |
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ | |
Licensed to The Apache Software Foundation, http://www.apache.org/ | |
Benchmarking webgeek.ph (be patient) | |
Completed 100 requests | |
Completed 200 requests | |
Completed 300 requests | |
Completed 400 requests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//logic shamelessly copied from https://github.com/imulus/retinajs | |
jQuery(document).ready(function() { | |
var replaceRetina = function(elem) { | |
if (elem.complete) { | |
var src = elem.src; | |
var path_segments = src.split('.'); | |
var path_without_extension = path_segments.slice(0, (path_segments.length - 1)).join("."); | |
var extension = path_segments[path_segments.length - 1]; | |
elem.setAttribute('width', elem.offsetWidth); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Stemmer | |
# Custom implementation of the Porter2 stemming algorithm | |
# http://snowball.tartarus.org/algorithms/english/stemmer.html | |
@getStems: (text) -> | |
exclusionList = ["", ",", "/", "&", "of", "the", "by", "a", "*", "-", "'", "'s", "=", ">", "s'", "\"", "~", "and", "with", "for", "in", "500ml", "to", "at", "or", "n", "x", "pcs"] | |
stems = (@stem(word) for word in text.split /[ ,()!:@\/]/) | |
(word for word in stems when word not in exclusionList and word.search(/^[\d]+(\.[\d]+)?"?$/) == -1) | |
@stem: (word) -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Animal | |
def initialize(name, age) | |
@name, @age = name, age | |
end | |
def getName | |
@name | |
end | |
def getAge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible | |
filetype off | |
set rtp+=~/.vim/bundle/vundle/ | |
call vundle#rc() | |
Bundle 'gmarik/vundle' | |
Bundle 'bzx/vim-theme-pack' | |
Bundle 'ap/vim-css-color' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Synapse | |
constructor: (@sourceNeuron, @destNeuron) -> | |
@prevWeight = @weight = (Math.random() * 2.0) - 1.0 | |
class Neuron | |
learningRate: 1.0 | |
momentum: 0.3 | |
constructor: -> | |
@synapsesIn = [] |