Changes between Version 1 and Version 2 of BackendUtilities


Ignore:
Timestamp:
Apr 25, 2007, 10:32:09 AM (17 years ago)
Author:
Nicolas
Comment:

Converted by an automatic script

Legend:

Unmodified
Added
Removed
Modified
  • BackendUtilities

    v1 v2  
    22
    33      The following functions can be used in your validator and assimilator code:
     4----
     5
     6{{{
     7int get_output_file_path(RESULT const&, std::string&);
     8}}}
     9      Returns the path of a result's output file (parses result.xml_doc_out and computes the file's position in the  [DirHierarchy hierarchical directory structure]).
     10{{{
     11int get_output_file_paths(RESULT const&, vector<string>&);
     12}}}
     13      Same, for multiple output files.
     14
     15
     16----
     17
    418{{{
    519int try_fopen(char* path, FILE*& f, char* mode);
    620}}}
    7       Open a file, distinguishing between recoverable and nonrecoverable errors. Returns zero on success. Returns ERR_FOPEN if the directory is present but not the file (this is considered a nonrecoverable error). Returns ERR_OPENDIR if the directory is not there (this is generally a recoverable error, like NFS mount failure).              [http://boinc.berkeley.edu// Return to BOINC main page]             Last modified 10:06 PM UTC, April 16 2007.              Copyright © 2007  University of California.         Permission is granted to copy, distribute and/or modify this document         under the terms of the GNU Free Documentation License,         Version 1.2 or any later version published by the Free Software Foundation.
     21      Open a file, distinguishing between recoverable and nonrecoverable errors. Returns zero on success. Returns ERR_FOPEN if the directory is present but not the file (this is considered a nonrecoverable error). Returns ERR_OPENDIR if the directory is not there (this is generally a recoverable error, like NFS mount failure).
     22----
    823
     24{{{
     25double median_mean_credit(vector<RESULT> const& results);
     26}}}
     27      Given a vector of N correct results, computes a canonical credit as follows:
     28 * if N==1, return that result's claimed credit
     29 * if N==2, return min of claimed credits
     30 * if N>2, toss out high and low claimed credit, and return the average of the rest.
     31