Skip to content
Browse files

added python script to readme

  • Loading branch information...
1 parent 36183cf commit 6804535042464436c841951e6cdcb7a80af1179a @blackant blackant committed
Showing with 14 additions and 42 deletions.
  1. +4 −0 README.md
  2. +0 −32 ben.py
  3. +1 −1 js/datasets/index.json
  4. +9 −9 js/datasets/linux-filesizes.json
View
4 README.md
@@ -66,6 +66,10 @@ end
counter.results
```
+### Additional Tools
+
+[fweez](https://github.com/fweez) contributed the Linux filesize dataset and [created a Python script for tallying filesizes in a directory](https://gist.github.com/1049438).
+
## Updating Javascript and CSS
We're using CoffeeScript for the Javascript and Sass/Compass for the CSS.
View
32 ben.py
@@ -1,32 +0,0 @@
-#!/usr/bin/env python
-
-import os
-import subprocess
-
-# First, build up the results file. it'll have the form:
-# 110 vidioc-g-dv-preset.xml
-linecount_cmd = "rm results; for i in *; do find $i -execdir wc -c '{}' \; " + \
- ">> results; done;"
-os.system(linecount_cmd)
-
-# Then figure out how many are in each bucket (linecount's initial digit)
-bucket_cmd = 'for i in `jot 9`; do egrep "^[ ]*$i" results| ' + \
- 'wc -l; done > counts'
-os.system(bucket_cmd)
-
-# And how many total files there are...
-total_cmd = 'wc -l results'
-p = subprocess.Popen(total_cmd, stdout=subprocess.PIPE, shell=True)
-(total, _) = p.communicate()
-
-total = int(total.split()[0])
-
-for i,count in enumerate(file('counts', 'r').readlines()):
- print '"%d": %0.5f,' % (i + 1, 100 * (float(count) / total))
-
-print "Record count:", total
-
-os.system('echo "biggest:" && sort --general-numeric-sort -b results '
- '| tail -n 1')
-
-
View
2 js/datasets/index.json
@@ -4,6 +4,6 @@
"distance-of-stars-from-earth-in-light-years": "Distance of stars from Earth in light years",
"loan-amounts-on-kiva-org": "Loan amounts on kiva.org",
"total-number-of-print-materials-in-us-libraries": "Total number of print materials in US libraries",
- "population-of-spanish-cities": "Population of Spanish cities"
+ "population-of-spanish-cities": "Population of Spanish cities",
"linux-filesizes": "File sizes in the Linux 2.6.39.2 source tree"
}
View
18 js/datasets/linux-filesizes.json
@@ -1,14 +1,14 @@
{
"values": {
- "1": 30.30625,
- "2": 17.37780,
- "3": 13.03471,
- "4": 9.65342,
- "5": 7.78159,
- "6": 6.36750,
- "7": 5.74356,
- "8": 5.09237,
- "9": 4.64280
+ "1": 30.31,
+ "2": 17.38,
+ "3": 13.03,
+ "4": 9.65,
+ "5": 7.78,
+ "6": 6.37,
+ "7": 5.74,
+ "8": 5.09,
+ "9": 4.64
},
"num_records": "36,702",
"min_value": "1",

0 comments on commit 6804535

Please sign in to comment.
Something went wrong with that request. Please try again.