changeset 1004:6a76bed8aa32 browsing

Merge from live
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Fri, 09 Nov 2012 15:38:21 +0000
parents a2660a5eb395 (current diff) 96f4b03623ed (diff)
children 85123e5bc883
files
diffstat 8 files changed, 191 insertions(+), 80 deletions(-) [+]
line wrap: on
line diff
--- a/extra/soundsoftware/extract-javadoc.sh	Fri Nov 09 14:40:46 2012 +0000
+++ b/extra/soundsoftware/extract-javadoc.sh	Fri Nov 09 15:38:21 2012 +0000
@@ -35,8 +35,8 @@
 # package declarations
 
 find "$projectdir" -type f -name \*.java \
-    -exec grep '^ *package [a-zA-Z][a-zA-Z0-9\._-]*; *$' \{\} /dev/null \; |
-    sed -e 's/\/[^\/]*: *package */:/' -e 's/; *$//' |
+    -exec egrep '^ *package +[a-zA-Z][a-zA-Z0-9\._-]*;.*$' \{\} /dev/null \; |
+    sed -e 's/\/[^\/]*: *package */:/' -e 's/;.*$//' |
     sort | uniq | (
 	current_prefix=
 	current_packages=
--- a/extra/soundsoftware/get-statistics.rb	Fri Nov 09 14:40:46 2012 +0000
+++ b/extra/soundsoftware/get-statistics.rb	Fri Nov 09 15:38:21 2012 +0000
@@ -5,9 +5,19 @@
 # ./script/runner -e production extra/soundsoftware/get-statistics.rb 
 #
 
-d1 = Date.parse("20101201") # => 1 Dec 2010
+d1 = Date.parse("20100701") # => 1 Jul 2010
 d2 = Date.today
 
+def delta_array (iarray)
+  # returns an array with the deltas
+  ## prepends a zero and drops the last element
+  deltas = [0] + iarray
+  deltas = deltas.first(deltas.size - 1)
+
+  return iarray.zip(deltas).map { |x, y| x - y }
+
+end
+
 def months_between(d1, d2)
    months = []
    start_date = Date.civil(d1.year, d1.month, 1)
@@ -32,28 +42,106 @@
 
    while (start_date < end_date)
      weeks << start_date
-     start_date = start_date + 1.week
+     start_date = start_date + 2.week
    end
 
    weeks << end_date
 end
 
-# dates = months_between(d1, d2)
-dates = weeks_between(d1, d2)
+def get_user_project_evol_stats()
+  # dates = months_between(d1, d2)
+  dates = months_between(d1, d2)
+  
+  # number of users 
+  n_users = []
+  n_projects = []
+  qm_users = []
+  
+  dates.each do |date|
+    users =  User.find_by_sql ["SELECT * FROM users WHERE users.status = '1' AND users.created_on <= ?;", date]
+    projects =  Project.find_by_sql ["SELECT * FROM projects WHERE projects.created_on <= ?;", date]
+    
+    qm_users_list = User.find_by_sql ["SELECT * FROM users,ssamr_user_details WHERE users.status = '1' AND ssamr_user_details.user_id = users.id AND (users.mail like '%qmul%' OR ssamr_user_details.institution_id = '99') AND users.created_on <= ?;", date ]
+    
+    qm_users << qm_users_list.count
+    n_users << users.count
+    n_projects << projects.count
+    
+    #  private_projects =  Project.find(:all, :conditions => {:created_on  => d1..date, is_public => false})
+  end
+  
+  user_deltas = delta_array(n_users)
+  proj_deltas = delta_array(n_projects)
+  qm_user_deltas = delta_array(qm_users)
+  
+  puts "Date Users D_Users QM_Users D_QM_users Projects D_Projects"
+  
+  dates.zip(n_users, user_deltas, qm_users, qm_user_deltas, n_projects, proj_deltas).each do |a, b, c, d, e, f, g|
+    puts "#{a} #{b} #{c} #{d} #{e} #{f} #{g}"
+  end
+  
+end
 
-dates.each do |date|
-  users =  User.find(:all, :conditions => {:created_on  => d1..date})
-  all_projects =  Project.find(:all, :conditions => {:created_on  => d1..date})
-  private_projects =  Project.find(:all, :conditions => {:created_on  => d1..date, 
-                                                          :is_public => false})
-  top_level_and_private_projects =  Project.find(:all, :conditions => {:created_on  => d1..date,
-                                                                        :is_public => false, 
-                                                                        :parent_id => nil})
 
-  puts "#{date} #{users.count} #{all_projects.count} #{private_projects.count} #{top_level_and_private_projects.count}\n"
+def get_project_status()
+  date = "20121101"
+  
+   all_projects = Project.find(:all, :conditions => ["created_on < ?", date])
+  #  all_projects = Project.find(:all, :conditions => ["is_public = ? AND created_on < ?", true, date])
+#  all_projects = Project.find(:all, :conditions => ["is_public = ? AND created_on < ?", false, date])
+  
+  collab = []
+  users_per_proj = []
+  
+  #  puts "Public Users Institutions"
+
+  all_projects.each do |proj| 
+    insts = []
+
+    proj.users.each do |u|  
+      if u.institution == "" || u.institution == "No Institution Set"
+        if u.mail.include?("qmul.ac.uk") || u.mail.include?("andrewrobertson77")
+          insts << "Queen Mary, University of London"          
+        else
+          insts << u.mail
+        end
+      else
+        insts << u.institution
+      end
+    end
+
+    users_per_proj << proj.users.count
+    collab << insts.uniq.count
+  end
+  
+  
+  #  freq = collab.inject(Hash.new(0)) { |h,v| h[v] += 1; h }
+  #  freq = freq.sort_by {|key, value| value}
+  #  puts freq.inspect.sort
+
+  puts "Projects: #{all_projects.count} UpP: #{users_per_proj.sum / users_per_proj.size.to_f} Users1+: #{users_per_proj.count{|x| x> 1}} Users2+: #{users_per_proj.count{|x| x> 2}} Collab1+: #{collab.count{|x| x > 1}} Collab2+: #{collab.count{|x| x > 2}} IpP: #{collab.sum / collab.size.to_f}"
+end
+
+def get_user_projects_ratios()
+  user_projects = User.find(:all, :conditions=> {:status => 1})
+  pub_proj_user = user_projects.map{|u| u.projects.find(:all, :conditions=>{:is_public => true}).count}
+
+  user_projects.zip(pub_proj_user).each do |u, pub|
+      puts "#{u.projects.count} #{pub}"
+  end
 
 end
 
+def get_inst_list()
+  users = User.find(:all, :conditions => {:status => 1})
+  inst_list = users.map{|user| user.institution}
+  
+  freq = inst_list.inject(Hash.new(0)) { |h,v| h[v] += 1; h }
+  
+end
 
 
+# get_user_projects_ratios()
+# get_user_project_evol_stats()
 
+get_project_status()
--- a/public/stylesheets/application.css	Fri Nov 09 14:40:46 2012 +0000
+++ b/public/stylesheets/application.css	Fri Nov 09 15:38:21 2012 +0000
@@ -5,7 +5,7 @@
 h1 {margin:0; padding:0; font-size: 24px;}
 h2, .wiki h1 {font-size: 20px;padding: 2px 10px 1px 0px;margin: 0 0 10px 0; border-bottom: 1px solid #bbbbbb; color: #444;}
 h3, .wiki h2 {font-size: 16px;padding: 2px 10px 1px 0px;margin: 0 0 10px 0; border-bottom: 1px solid #bbbbbb; color: #444;}
-h4, .wiki h3 {font-size: 13px;padding: 2px 10px 1px 0px;margin-bottom: 5px; border-bottom: 1px dotted #bbbbbb; color: #444;}
+h4, .wiki h3 {font-size: 14px;padding: 2px 10px 1px 0px;margin-bottom: 5px; border-bottom: 1px dotted #bbbbbb; color: #444;}
 
 /***** Layout *****/
 #wrapper {background: white;}
@@ -24,14 +24,14 @@
 
 #account {float:right;}
 
-#header {height:5.3em;margin:0;background-color:#507AAA;color:#f8f8f8; padding: 4px 8px 0px 6px; position:relative;}
+#header {height:68px;margin:0;background-color:#507AAA;color:#f8f8f8; padding: 4px 8px 0px 6px; position:relative;}
 #header a {color:#f8f8f8;}
 #header h1 a.ancestor { font-size: 80%; }
 
 #project-search-jump {float:right; }
 
 
-#main-menu {position: absolute;  bottom: 0px;  left:6px; margin-right: -500px;}
+#main-menu {position: absolute;  bottom: 0px;  left:8px; margin-right: -500px;}
 #main-menu ul {margin: 0;  padding: 0;}
 #main-menu li {
   float:left;
--- a/public/themes/soundsoftware/stylesheets/application.css	Fri Nov 09 14:40:46 2012 +0000
+++ b/public/themes/soundsoftware/stylesheets/application.css	Fri Nov 09 15:38:21 2012 +0000
@@ -34,7 +34,7 @@
 
 h2,h3,h4,.wiki h1 {
   color: #3e442c;
-  font-weight: bold;
+/*  font-weight: bold; */
 }
 
 .wiki h2,.wiki h3,.wiki h4 {
@@ -119,14 +119,14 @@
 #quick-search { margin-right: 6px; margin-top: 1em; color: #000; }
 #project-jump-box { float: right;  margin-right: 6px; margin-top: 5px; color: #000; }
 #project-ancestors-title {
-    margin-bottom: 0px;
+    margin-bottom: -6px;
     margin-left: 12px;
     margin-top: 6px;
 }
 
-#main-menu { position: absolute; top: 100px; /* background-color: #be5700; */ left: 0; border-top: 0; width: 100%;/* height: 1.82em; */ padding: 0; margin: 0; border: 0; }
+#main-menu { position: absolute; top: 100px; /* background-color: #be5700; */ left: 2px; border-top: 0; width: 100%;/* height: 1.82em; */ padding: 0; margin: 0; border: 0; }
 #main-menu li { margin: 0; padding: 0; }
-#main-menu li a { background-color: #fdfbf5; color: #be5700; border-right: 1px solid #a9b680; font-size: 97%; padding: 0em 8px 0.2em 10px; font-weight: normal; }
+#main-menu li a { background-color: #fdfbf5; color: #be5700; border-right: 1px solid #a9b680; font-size: 97%; padding: 0em 8px 0em 10px; font-weight: normal; }
 #main-menu li:last-child a { border-right: 0; }
 #main-menu li a:hover { background-color: #fdfbf5; color: #be5700; text-decoration: underline; }
 #main-menu li a.selected, #main-menu li a.selected:hover { background-color: #fdfbf5; color: #3e442c; }
@@ -145,7 +145,9 @@
 h2, h3, h4, .wiki h1, .wiki h2, .wiki h3 { border-bottom: 0px; }
 /*h2, .wiki h1 { letter-spacing:-1px; }
 */
-h4 { border-bottom: dotted 1px #c0c0c0; }
+/* h4 { border-bottom: dotted 1px #c0c0c0; } */
+
+.wiki p { margin-left: 3em; margin-right: 3em; }
 
 div.issue { background: #fdfaf0; border: 1px solid #a9b680; border-left: 4px solid #a9b680; }
 
--- a/public/themes/soundsoftware/stylesheets/fonts-generic.css	Fri Nov 09 14:40:46 2012 +0000
+++ b/public/themes/soundsoftware/stylesheets/fonts-generic.css	Fri Nov 09 15:38:21 2012 +0000
@@ -1,12 +1,24 @@
 @import url(fonts.css);
 
-h1, #project-ancestors-title {
-  font-family: GilliusADFNo2, 'Gill Sans', Tahoma, sans-serif;
-  font-weight: normal;
+h1, #project-ancestors-title, #top-menu a {
+  font-family: Insider, 'Gill Sans', Tahoma, sans-serif;
+  font-weight: bold;
 }    
 
-body,p,h2,h3,h4,li,table,.wiki h1,.embedded h1 { 
-  font-family: DroidSans, 'Liberation Sans', tahoma, verdana, sans-serif; 
+#top-menu div, #top-menu li {
+  font-size: 12px;
+}
+
+body,p,li,table { 
+  font-family: Insider, DroidSans, 'Liberation Sans', tahoma, verdana, sans-serif; 
+  font-size: 14px;
+  line-height: 1.34;
+  font-weight: normal;
+}
+
+h2,h3,h4,.wiki h1,.embedded h1 { 
+  font-family: Insider, DroidSans, 'Liberation Sans', tahoma, verdana, sans-serif; 
+  font-weight: bold;
   line-height: 1.34;
 }
 
--- a/public/themes/soundsoftware/stylesheets/fonts-mac.css	Fri Nov 09 14:40:46 2012 +0000
+++ b/public/themes/soundsoftware/stylesheets/fonts-mac.css	Fri Nov 09 15:38:21 2012 +0000
@@ -1,11 +1,24 @@
 @import url(fonts.css);
 
-h1, #project-ancestors-title {
-  font-family: GilliusADFNo2, 'Gill Sans', Tahoma, sans-serif;
-  font-weight: normal;
+h1, #project-ancestors-title, #top-menu a {
+  font-family: Insider, "Lucida Grande", sans-serif;
+  font-weight: bold;
 }    
 
-body,p,h2,h3,h4,li,table,.wiki h1,.embedded h1 { 
-  font-family: 'Lucida Grande', 'Lucida Sans Unicode', DroidSans, 'Liberation Sans', tahoma, verdana, sans-serif; 
+#top-menu div, #top-menu li {
+  font-size: 12px;
+}
+
+body,p,li,table { 
+  font-family: Insider, "Lucida Grande", sans-serif;
+  font-size: 14px;
+  line-height: 1.34;
+  font-weight: normal;
+}
+
+h2,h3,h4,.wiki h1,.embedded h1 { 
+  font-family: Insider, "Lucida Grande", sans-serif;
+  font-weight: bold;
   line-height: 1.34;
 }
+
--- a/public/themes/soundsoftware/stylesheets/fonts-ms.css	Fri Nov 09 14:40:46 2012 +0000
+++ b/public/themes/soundsoftware/stylesheets/fonts-ms.css	Fri Nov 09 15:38:21 2012 +0000
@@ -1,11 +1,26 @@
 @import url(fonts.css);
 
-h1, #project-ancestors-title {
-  font-family: GilliusADFNo2, 'Gill Sans', Tahoma, sans-serif;
+/* IE likes us to separate out normal & bold into different fonts
+   rather than use the selectors on the same font */
+
+h1, #project-ancestors-title, #top-menu a {
+  font-family: Insider-Medium, Tahoma, sans-serif;
   font-weight: normal;
 }    
 
-body,p,h2,h3,h4,li,table,.wiki h1,.embedded h1 { 
-  font-family: Calibri, DroidSans, 'Liberation Sans', tahoma, verdana, sans-serif; 
+#top-menu div, #top-menu li {
+  font-size: 12px;
+}
+
+body,p,li,table { 
+  font-family: Insider-Regular, tahoma, verdana, sans-serif; 
+  font-size: 14px;
+  line-height: 1.34;
+  font-weight: normal;
+}
+
+h2,h3,h4,.wiki h1,.embedded h1 { 
+  font-family: Insider-Medium, tahoma, verdana, sans-serif; 
+  font-weight: normal;
   line-height: 1.34;
 }
--- a/public/themes/soundsoftware/stylesheets/fonts.css	Fri Nov 09 14:40:46 2012 +0000
+++ b/public/themes/soundsoftware/stylesheets/fonts.css	Fri Nov 09 15:38:21 2012 +0000
@@ -1,51 +1,32 @@
-
-/* Font pack generated by FontSquirrel */
 
 @font-face {
-	font-family: 'GilliusADFNo2';
-	src: url('fonts/gilliusadfno2-bolditalic-webfont.eot');
-	src: local('☺'), url('fonts/gilliusadfno2-bolditalic-webfont.woff') format('woff'), url('fonts/gilliusadfno2-bolditalic-webfont.ttf') format('truetype'), url('fonts/GilliusADFNo2-BoldItalic.otf') format('opentype'), url('fonts/gilliusadfno2-bolditalic-webfont.svg#webfontLmhvPwzc') format('svg');
-	font-weight: bold;
-	font-style: italic;
+    font-family: 'Insider';
+    font-weight: bold;
+    font-style: normal;
+    src: url('fonts/24BC0E_0_0.eot');
+    src: url('fonts/24BC0E_0_0.eot?#iefix') format('embedded-opentype'), url('fonts/24BC0E_0_0.woff') format('woff'), url('fonts/24BC0E_0_0.ttf') format('truetype');
+}
+ 
+@font-face {
+    font-family: 'Insider';
+    font-weight: normal;
+    font-style: normal;
+    src: url('fonts/24BC35_0_0.eot');
+    src: url('fonts/24BC35_0_0.eot?#iefix') format('embedded-opentype'), url('fonts/24BC35_0_0.woff') format('woff'), url('fonts/24BC35_0_0.ttf') format('truetype');
 }
 
 @font-face {
-	font-family: 'GilliusADFNo2';
-	src: url('fonts/gilliusadfno2-italic-webfont.eot');
-	src: local('☺'), url('fonts/gilliusadfno2-italic-webfont.woff') format('woff'), url('fonts/gilliusadfno2-italic-webfont.ttf') format('truetype'), url('fonts/GilliusADFNo2-Italic.otf') format('opentype'), url('fonts/gilliusadfno2-italic-webfont.svg#webfonteHBtzgS0') format('svg');
-	font-weight: normal;
-	font-style: italic;
+    font-family: 'Insider-Medium';
+    font-weight: normal;
+    font-style: normal;
+    src: url('fonts/24BC0E_0_0.eot');
+    src: url('fonts/24BC0E_0_0.eot?#iefix') format('embedded-opentype'), url('fonts/24BC0E_0_0.woff') format('woff'), url('fonts/24BC0E_0_0.ttf') format('truetype');
 }
-
+ 
 @font-face {
-	font-family: 'GilliusADFNo2';
-	src: url('fonts/gilliusadfno2-bold-webfont.eot');
-	src: local('☺'), url('fonts/gilliusadfno2-bold-webfont.woff') format('woff'), url('fonts/gilliusadfno2-bold-webfont.ttf') format('truetype'), url('fonts/GilliusADFNo2-Bold.otf') format('opentype'), url('fonts/gilliusadfno2-bold-webfont.svg#webfontntXmQMqk') format('svg');
-	font-weight: bold;
-	font-style: normal;
+    font-family: 'Insider-Regular';
+    font-weight: normal;
+    font-style: normal;
+    src: url('fonts/24BC35_0_0.eot');
+    src: url('fonts/24BC35_0_0.eot?#iefix') format('embedded-opentype'), url('fonts/24BC35_0_0.woff') format('woff'), url('fonts/24BC35_0_0.ttf') format('truetype');
 }
-
-@font-face {
-	font-family: 'GilliusADFNo2';
-	src: url('fonts/gilliusadfno2-regular-webfont.eot');
-	src: local('☺'), url('fonts/gilliusadfno2-regular-webfont.woff') format('woff'), url('fonts/gilliusadfno2-regular-webfont.ttf') format('truetype'), url('fonts/GilliusADFNo2-Regular.otf') format('opentype'), url('fonts/gilliusadfno2-regular-webfont.svg#webfontvJUiAdi3') format('svg');
-	font-weight: normal;
-	font-style: normal;
-}
-
-@font-face {
-	font-family: 'DroidSans';
-	src: url('fonts/DroidSans-webfont.eot');
-	src: local('☺'), url('fonts/DroidSans-webfont.woff') format('woff'), url('fonts/DroidSans-webfont.ttf') format('truetype'), url('fonts/DroidSans-webfont.svg#webfontKYIQSBQk') format('svg');
-	font-weight: normal;
-	font-style: normal;
-}
-
-@font-face {
-	font-family: 'DroidSans';
-	src: url('fonts/DroidSans-Bold-webfont.eot');
-	src: local('☺'), url('fonts/DroidSans-Bold-webfont.woff') format('woff'), url('fonts/DroidSans-Bold-webfont.ttf') format('truetype'), url('fonts/DroidSans-Bold-webfont.svg#webfontljpTCDjw') format('svg');
-	font-weight: bold;
-	font-style: normal;
-}
-