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
1 10.0.1.1 (10.0.1.1) 0.954 ms 0.775 ms 2.437 ms | |
2 cpe-98-14-80-1.nyc.res.rr.com (98.14.80.1) 9.815 ms 9.027 ms 9.670 ms | |
3 gig-2-14-nycmnyr-rtr1.nyc.rr.com (24.29.157.25) 12.519 ms 8.980 ms 10.487 ms | |
4 gig10-0-0-nycmnya-rtr1.nyc.rr.com (24.29.157.98) 8.909 ms 8.598 ms 9.500 ms | |
5 tenge-0-3-0-nwrknjmd-rtr.nyc.rr.com (24.29.97.6) 12.971 ms 10.117 ms 9.746 ms | |
6 ae-4-0.cr0.nyc30.tbone.rr.com (66.109.6.78) 9.278 ms 9.223 ms 43.665 ms | |
7 ae-1-0.pr0.nyc30.tbone.rr.com (66.109.6.161) 43.319 ms 8.634 ms 9.928 ms | |
8 xe-4-3-0.edge2.newark1.level3.net (4.59.20.161) 9.459 ms 10.364 ms 9.663 ms | |
9 ae-32-52.ebr2.newark1.level3.net (4.68.99.62) 14.356 ms 36.022 ms 17.790 ms | |
10 ae-4-4.ebr2.washington1.level3.net (4.69.132.101) 16.215 ms 15.545 ms 15.891 ms |
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
# Sieve of Eratosthenes | |
# (an array loaded with prime numbers) | |
base = [2..10000] | |
primes = [] | |
sieve = (set, pos) -> | |
return false if pos >= set.length | |
if set[pos] * set[pos] < set[set.length-1] | |
primes = _.select set, ((num) -> | |
return num if num == set[pos] | |
return num % set[pos] != 0 |
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
for n in 0..100 | |
for m in 1..100 | |
if (m>n) | |
a = 2*m*n | |
b = (m**2 - n**2) | |
c = (m**2 + n**2) | |
end | |
if (a + b + c == 1000) | |
puts "Triplet = #{a} + #{b} = #{c} of which the product is #{a*b*c}" |
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
# Project Euler #3 -> http://projecteuler.net/index.php?section=problems&id=3 | |
# Q: What is the largest prime factor of the number 600851475143 ? | |
# Generate a Sieve of Eratosthenes (an array loaded with prime numbers) | |
primes = [] | |
sieve = (set, pos) -> | |
return false if pos >= set.length | |
if set[pos] * set[pos] < set[set.length-1] | |
primes = (x for x in set when x == set[pos] or x % set[pos] != 0) | |
return sieve(primes,pos+1) |
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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8"> | |
<title>Index</title> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript" charset="utf-8"></script> | |
</head> | |
<body> | |
<form action="index_submit" method="get" accept-charset="utf-8"> |
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
[default] Running chef-solo... | |
[default] stdin: is not a tty | |
: stderr | |
[default] [Sat, 05 Feb 2011 05:32:39 -0800] INFO: Setting the run_list to ["recipe[vagrant_main]"] from JSON | |
[Sat, 05 Feb 2011 05:32:39 -0800] INFO: Starting Chef Run (Version 0.9.12) | |
: stdout | |
[default] [Sat, 05 Feb 2011 05:32:47 -0800] INFO: Ran execute[apt-get update] successfully | |
[Sat, 05 Feb 2011 05:32:48 -0800] FATAL: No cookbook found in ["/tmp/vagrant-chef/cookbooks-0", "/tmp/vagrant-chef/cookbooks"], make sure cookbook_path is set correctly. |
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
<?php | |
function stopWords($text, $stopwords) { | |
// Remove line breaks and spaces from stopwords | |
$stopwords = array_map(function($x){return trim(strtolower($x));}, $stopwords); | |
// Replace all non-word chars with comma | |
$pattern = '/[0-9\W]/'; | |
$text = preg_replace($pattern, ',', $text); |
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
<? | |
// Quicksilver Score | |
// | |
// A port of the Quicksilver string ranking algorithm | |
// (re-ported from Javascript to PHP by Kenzie Campbell) | |
// http://route19.com/logbook/view/quicksilver-score-in-php | |
// | |
// score("hello world","axl") //=> 0.0 | |
// score("hello world","ow") //=> 0.6 |
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
Array.prototype.evens = function() { | |
var arr = this; | |
var out = []; | |
var count = 0; | |
var even = function(arr, out) { | |
if (count <= arr.length - 1) { | |
if ((arr[count] % 2) === 0) { | |
out.push(arr[count]); | |
} | |
count++; |
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
/** | |
* Creates an ArrayBuffer, converts the binary to a Uint8 Array, and | |
* places the buffer in a DataView, which is needed to create a Blob | |
**/ | |
_makeBlob: function(binary) { | |
var data = new ArrayBuffer(binary.length), | |
mimeString = "text/plain", | |
ui8a = new Uint8Array(data, 0), | |
dataView, | |
blob; |