I’m at the postmodern programming conference in London today (pomopro) . Part of the day consists of a scrapheap challlenge – you might know the program scrapheap challenge from Discovery Channel.
Part of the challenge is we post our results on a blog… so here goes…
Emmanual Gaillot and yours truly paired up to produce something that plots a graph of the sloppiness of a progam in a subversion repository over time. We had ninety minutes to do so.
Emmanuel learnt svn, pmd and cpd (copy paste detection). I learnt grep -c..
here is the code:
#!/usr/bin/ruby
require 'fileutils'
revision = 54
#puts system('svn co http://stclass.tigris.org/svn/stclass/trunk/src_4x/src/java/org/stclass/runtime --username guest --password "" -r' + revision.to_s)
FileUtils.cd 'runtime'
outputs = []
(20..59).each do | revision |
`svn up -r #{revision.to_s}`
result = `java net.sourceforge.pmd.cpd.CPD --minimum-tokens 10 --files . | grep -c "^Found a" `
outputs << revision.to_s + "t" + result.to_s
end
puts outputs.join("")
0 Responses to “postmodern programming contest”