-
Download and build the newest haddock. The build instructions are in
README.md
.git clone https://github.com/haskell/haddock.git cd haddock
cabal sandbox init cabal sandbox add-source haddock-library cabal sandbox add-source haddock-api cabal install --dependencies-only
This file contains hidden or 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
=====cmd:start="rvm list"= | |
rvm rubies | |
[32mgoruby(B[m [ x86_64 ] | |
[32mrbx-head-default_1.9(B[m [ x86_64 ] | |
[32mruby-1.8.6-p420(B[m [ x86_64 ] | |
[32mruby-1.8.7-p352(B[m [ x86_64 ] | |
[32mmaglev-26852(B[m [ x86_64 ] | |
[32mruby-1.9.2-p290-named(B[m [ x86_64 ] |
This file contains hidden or 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
# Note: | |
# RVM does not control the system Ruby or its gems. Only Rubies and gems installed by RVM are under it's control! | |
# Install RVM | |
$ gpg --keyserver hkp://keys.gnupg.net --recv-keys D39DC0E3 | |
$ \curl -sSL https://get.rvm.io | bash -s stable --ruby | |
$ source /home/ubuntu/.rvm/scripts/rvm | |
# Install a Ruby version | |
$ rvm install ruby-1.9.3 |
This file contains hidden or 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
Host * | |
CheckHostIP yes | |
Compression yes | |
IdentityFile ~/.ssh/id_rsa | |
Protocol 2 | |
AddressFamily inet | |
IdentitiesOnly yes | |
KexAlgorithms [email protected] | |
PasswordAuthentication no | |
ChallengeResponseAuthentication no |
This file contains hidden or 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
ROUTES = { | |
"GET /" => ["RootController", :show], | |
"GET /home" => ["HomeController", :index], | |
"GET /posts/:slug/comments/:id/edit" => ["CommentsController", :edit], | |
"POST /posts/:slug/comments" => ["CommentsController", :create], | |
"PUT /posts/:slug" => ["PostsController", :update] | |
} | |
router = Router.new ROUTES |
This file contains hidden or 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
#!/usr/bin/env python | |
from __future__ import print_function | |
import csv | |
import sys | |
import xml.etree.ElementTree as etree | |
import pyx | |
import pyx.connector |
This file contains hidden or 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
/* HAS ATTRIBUTE */ | |
$.fn.hasAttr = function(attrName){ | |
var element = this[0]; | |
if(element.hasAttribute){ | |
return element.hasAttribute(attrName); |
This file contains hidden or 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
function include(url,success) { | |
var head = document.getElementsByTagName("head")[0], done = false; | |
var script = document.createElement("script"); | |
script.src = url; | |
// Attach handlers for all browsers | |
script.onload = script.onreadystatechange = function(){ | |
if (!done && (!this.readyState || this.readyState === "loaded" || this.readyState === "complete") ) { | |
done = true; | |
if (typeof success === 'function') success(); | |
} |
The problem:
Create a hash from an array of objects where the key is the object's #id
and the value is the #stuff
method.
Known/Suspected caveats:
- Garbage collection might be happening, making the results lie.
- Not exhaustive of ways to create a hash from an array
- Not exhaustive of ways to call
Benchmark.ips
with code to test. (no strings yet) - Not able to manually change the number of iterations
Implementations of Happy Numbers
Simple recursive version that stores the previous steps in the sequence in an array, and checks for duplicates to detect cycles.
Can get up to 250,000,000 numbers in ~5s, with no memoisation:
$ time ./happy_numbers 350000000