Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: igrigorik/bmr-wordcount
base: master
...
head fork: tovbinm/bmr-wordcount
compare: master
Checking mergeability… Don't worry, you can still create the pull request.
  • 1 commit
  • 3 files changed
  • 0 commit comments
  • 1 contributor
Commits on Jul 28, 2011
@tovbinm tovbinm + Reduce separator changed
+ sinatra bind set to 0.0.0.0
9dc1123
Showing with 5 additions and 4 deletions.
  1. +1 −0  jobserver.rb
  2. +3 −3 views/layout.erb
  3. +1 −1  views/reduce.erb
View
1  jobserver.rb
@@ -15,6 +15,7 @@
set :map_jobs, Dir.glob("data/*.txt")
set :reduce_jobs, []
set :result, nil
+ set :bind, '0.0.0.0'
end
get "/" do
View
6 views/layout.erb
@@ -3,14 +3,14 @@
<script type="text/javascript" defer>
function map() {
- var words = document.body.innerHTML.split(/\n|\s/).length;
+ var words = document.body.innerHTML.split(/\n|\s/).length;
emit('reduce', {'count': words});
}
function reduce() {
var sum = 0;
- var docs = document.body.innerHTML.split(/\n/);
- for (num in docs) { sum += ((parseInt(num) > 0) ? parseInt(num) : 0) }
+ var docs = document.body.innerHTML.split(/\|/);
+ for(i=0;i<docs.length;i++){ sum += ((parseInt(docs[i]) > 0) ? parseInt(docs[i]) : 0); }
emit('finalize', {'sum': sum});
}
View
2  views/reduce.erb
@@ -1,2 +1,2 @@
<% @execute = "reduce" %>
-<%= data.join("\n") %>
+<%= data.join("|") %>

No commit comments for this range

Something went wrong with that request. Please try again.