bts-cm / boinc-field-mod Goto Github PK
View Code? Open in Web Editor NEWThis project forked from mercosity/project-rain-site
Adding 3rd party project field to BOINC
License: MIT License
This project forked from mercosity/project-rain-site
Adding 3rd party project field to BOINC
License: MIT License
Change 'bitshares' to 'user_data' , 'project_rain' and 'boinc_rain' to something simple & non-crypto related.
Reason: BOINC/boinc#2009 (comment)
Simply added a field to the export, untested & may be unable to access $project_rain table?
"<team>
<name>".escape($team->name)."</name>
<url>".escape($team->url)."</url>
<type>$team->type</type>
<name_html>".escape($team->name_html)."</name_html>
<description>
".escape($team->description)."
</description>
<country>$team->country</country>
<id>$team->id</id>
<user_email_munged>$user_email_munged</user_email_munged>
<user_name>".escape($user->name)."</user_name>
<user_country>".escape($user->country)."</user_country>
<user_postal_code>".escape($user->postal_code)."</user_postal_code>
<user_bitshares>".escape($project_rain->bitshares)."</user_bitshares>
<user_url>".escape($user->url)."</user_url>
</team>
"
class User(DatabaseObject):
_table = DatabaseTable(
table = 'user',
columns = [ 'create_time',
'email_addr',
'name',
'authenticator',
'country',
'postal_code',
'total_credit',
'expavg_credit',
'expavg_time',
'global_prefs',
'project_prefs',
'teamid',
'venue',
'url',
'send_email',
'show_hosts',
'posts',
'seti_id',
'seti_nresults',
'seti_last_result_time',
'seti_total_cpu',
'signature',
'has_profile',
'cross_project_id',
'passwd_hash',
'email_validated',
'donated'
])
class Project_Rain(DatabaseObject):
_table = DatabaseTable(
table = 'project_rain',
columns = [ 'authenticator',
'cross_project_id',
'bitshares'
])
class DB_USER : public DB_BASE, public USER {
public:
DB_USER(DB_CONN* p=0);
DB_ID_TYPE get_id();
void db_print(char*);
void db_parse(MYSQL_ROW &row);
void operator=(USER& r) {USER::operator=(r);}
};
struct DB_USER_ : public DB_BASE, public PROJECT_RAIN {
public:
DB_PROJECT_RAIN(DB_CONN* p=0);
DB_ID_TYPE get_id();
void db_print(char*);
void db_parse(MYSQL_ROW &row);
void operator=(PROJECT_RAIN& r) {PROJECT_RAIN::operator=(r);}
};
Investigate changing:
"This program generates XML files containing project statistics."
"It should be run once a day as a periodic task in config.xml."
"For more info, see https://boinc.berkeley.edu/trac/wiki/DbDump"
"Usage: %s [options]"
"Options:"
" --dump_spec filename Use the given config file (use ../db_dump_spec.xml)"
" [-d N | --debug_level] Set verbosity level (1 to 4)"
" [--db_host H] Use the DB server on host H"
" [--retry_period H] When can't connect to DB, retry after N sec instead of terminating"
" [-h | --help] Show this"
" [-v | --version] Show version information",
void write_user(USER& user, FILE* f, bool /*detail*/) {
char buf[1024];
char cpid[MD5_LEN];
char name[2048], url[2048];
xml_escape(user.name, name, sizeof(name));
xml_escape(user.url, url, sizeof(url));
safe_strcpy(buf, user.cross_project_id);
safe_strcat(buf, user.email_addr);
md5_block((unsigned char*)buf, strlen(buf), cpid);
fprintf(f,
"<user>"
" <id>%lu</id>"
" <name>%s</name>"
" <country>%s</country>"
" <create_time>%d</create_time>"
" <total_credit>%f</total_credit>"
" <expavg_credit>%f</expavg_credit>"
" <expavg_time>%f</expavg_time>"
" <cpid>%s</cpid>",
user.id,
name,
user.country,
user.create_time,
user.total_credit,
user.expavg_credit,
user.expavg_time,
cpid
);
if (strlen(user.url)) {
fprintf(f,
" <url>%s</url>",
url
);
}
if (user.teamid) {
fprintf(f,
" <teamid>%lu</teamid>",
user.teamid
);
}
if (user.has_profile) {
fprintf(f,
" <has_profile/>"
);
}
fprintf(f,
"</user>"
);
}
void write_rain(RAIN& rain, USER& user, FILE* f, bool /*detail*/) {
char buf[1024];
char cpid[MD5_LEN];
safe_strcpy(buf, user.cross_project_id);
safe_strcat(buf, user.email_addr);
md5_block((unsigned char*)buf, strlen(buf), cpid);
if (user.rain) {
fprintf(f,
"<u>"
" <id>%lu</id>"
" <trac>%f</trac>"
" <rac>%f</rac>"
" <cpid>%s</cpid>"
" <rain>%s</rain>"
"</u>",
user.id,
user.total_credit,
user.expavg_credit,
cpid,
rain.data
);
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.