Skip to content

Instantly share code, notes, and snippets.

View michaeltwofish's full-sized avatar

Michael C. Harris michaeltwofish

  • South Australia, Australia
View GitHub Profile
173.45.230.87 - - [02/Jun/2011:02:38:21 +0000] "GET /georgiathorpe.com/cron/1306982901.0181?asyncronous=%7BSSHA512%7DkePgS0XEWhghr2Ls%2FOPrU8gWIPhzVff5Chx7rufQ4uUbvgbqGD%2FTx7Ka1xSwaFkZIVWMwjZiisYaTNdUvh7lVXv4RDQ%3D HTTP/1.1" 200 395 "-" "Habari/0.7"
173.45.230.87 - - [02/Jun/2011:02:38:20 +0000] "GET /georgiathorpe.com/cron/1306982900.1781?asyncronous=%7BSSHA512%7DZUQCWXG5z89tkmlBsnzNuPG6iELFiNlKChzSGU9s0m98X54pAuewr6tXQx5Zpye6N2L%2BMeqG5EAkudICyjJ%2BVMk7uAg%3D HTTP/1.1" 200 395 "-" "Habari/0.7"
173.45.230.87 - - [02/Jun/2011:02:38:21 +0000] "GET /georgiathorpe.com/cron/1306982901.8281?asyncronous=%7BSSHA512%7DAvwSwknOFuT8lvRutUG9%2B2NazUxc1RCETOpSQ9apcgk1vVHQaEygD6%2Bi3qzQkw%2Fb9dNm58ULjlB8pFBjOwNoqTrKZfQ%3D HTTP/1.1" 200 395 "-" "Habari/0.7"
173.45.230.87 - - [02/Jun/2011:02:38:21 +0000] "GET /georgiathorpe.com/cron/1306982901.9281?asyncronous=%7BSSHA512%7DMyeHKAnEeTm2fVD1sPQpFtCZ45imNILNAktDGKbnQYuDF6L6By7Yzkb34%2BL3I%2F17q5NVAcMtJ3h08xZp4sQaOQxKqI4%3D HTTP/1.1" 200 395 "-" "Habari/0.7"
173.45.230.87 - -
<?php
Validator::add('uniqueFieldForClient', function($value, $format = null, $options = array()) {
$class = $options['class'];
$field = $options['field'];
$conditions = array($field => $value);
if (isset($options['values']['id'])) {
$conditions[] = 'id != ' . $options['values']['id'];
}
Fatal error: Class name must be a valid object or a string in /usr/local/www/oars/libraries/lithium/libraries/lithium/data/source/Database.php on line 448 Call Stack: 0.0002 327136 1. {main}() /usr/local/www/oars/webroot/index.php:0 0.0260 1563444 2. lithium\action\Dispatcher::run() /usr/local/www/oars/webroot/index.php:36 0.0260 1564600 3. lithium\core\StaticObject::_filter() /usr/local/www/oars/libraries/lithium/libraries/lithium/action/Dispatcher.php:123 0.0260 1566044 4. lithium\util\collection\Filters::run() /usr/local/www/oars/libraries/lithium/libraries/lithium/core/StaticObject.php:126 0.0261 1567916 5. {closure}() /usr/local/www/oars/libraries/lithium/libraries/lithium/util/collection/Filters.php:182 0.0381 1855392 6. lithium\util\collection\Filters->next() /usr/local/www/oars/config/bootstrap/action.php:58 0.0381 1855420 7. {closure}() /usr/local/www/oars/libraries/lithium/libraries/lithium/util/collection/Filters.php:201 0.0387 1855744 8. lithium\util\collection\Filters->next() /usr/local/www/oars/
Feature: Create Candidates
In order to manage tests for candidates
As an admin
I want to be able to create candidates
def unweightedAUC
total = 0
(0..(self.m_NumClasses - 1)).each do |index|
auc = areaUnderROC(index)
print "Class: #{index} AUC: #{auc}"
total += auc
end
puts
total.to_f/self.m_NumClasses
end
> dat
classifier depth average
1 bayes 0 3.5639098
2 bayes 1 6.0000000
3 bayes 2 3.0253165
4 bayes 3 5.2250000
5 bayes 4 1.7931034
6 bayes 5 2.6800000
7 bayes 6 3.6551724
8 adaboost 0 9.2857143
def unweightedAUC
total = 0
(0..(self.m_NumClasses - 1)).each do |index|
total += areaUnderROC(index)
end
total.to_f/self.m_NumClasses
end
And the following clusters exist:
| id | name | description |
| 1 | Cluster 1 | Some description |
Given /^the following clusters exist:$/ do |clusters_table|
# item_table is a Cucumber::Ast::Table
item_table.hashes.each do |cluster|
insert_into_clusters(cluster)
end
end
@michaeltwofish
michaeltwofish / step_definitions.rb
Created March 8, 2011 21:59
Using XPath in webrat to specify that one element should come before another. Using id but could use anything.
Then /^I should see element "([^"]*)" before element "([^"]*)"$/ do |first, second|
xpath = "//*[@id='#{first}']/following-sibling::*[@id='#{second}']"
response_body.should have_xpath(xpath)
end
Failing Scenarios:
cucumber ./cluster_create.feature:6 # Scenario: View the clusters page
cucumber ./cluster_create.feature:21 # Scenario: Create a new cluster
cucumber ./cluster_create.feature:27 # Scenario: Create a cluster and be directed to the clusters page
cucumber ./cluster_create.feature:77 # Scenario: Create a cluster and be directed to the clusters page
cucumber ./cluster_create.feature:86 # Scenario: Create a cluster when no forms exist
cucumber ./unit_update.feature:183 # Scenario: View a unit that has one item and see the item position
cucumber ./unit_update.feature:191 # Scenario: View a unit that has two items and see the item position
cucumber ./unit_retrieve.feature:34 # Scenario: Visit units page with one unit and see view link
cucumber ./form_retrieve.feature:28 # Scenario: Visit forms page with one form and see view link