This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
filters.source: | |
function(doc, req) { | |
if(!req.query.source) | |
throw("Please provide a query parameter `source`."); | |
if (doc.source && doc.source == req.query.source) | |
return true; | |
else | |
return false; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Tue, 14 Sep 2010 05:44:03 GMT] [error] [<0.98.0>] {error_report,<0.30.0>, | |
{<0.98.0>,crash_report, | |
[[{pid,<0.98.0>}, | |
{registered_name,[]}, | |
{error_info, | |
{exit, | |
{{badmatch,{error,eacces}}, | |
[{couch_file,init,1}, | |
{gen_server,init_it,6}, | |
{proc_lib,init_p_do_apply,3}]}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Response produced when using no credentials, | |
//$ curl http://minion:5984/cgm/_fti/_design/couchapp/user | |
// | |
{"error":"unauthorized","reason":"You are not authorized to access this db."} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
May your signals all trap | |
May your references be bounded | |
All memory aligned | |
Floats to ints rounded | |
Remember ... | |
Non-zero is true | |
++ adds one | |
Arrays start with zero |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[root@limbo /]# chmod 777 /var/import/cass | |
[root@limbo /]# su hubprod -c "touch /var/import/cass/test.txt" | |
touch: cannot touch `/var/import/cass/test.txt': Permission denied |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Encryption / Decryption : Alice and Bob (and Eve!) [DRAFT] | |
Overview: | |
* Teams must devise a novel ciphering scheme in a short amount of time. | |
* Each team nominates a 'transmitter', who attempts to securely send a given message back to their team. | |
* Each team attempts to decode their own message, and intercept the messages of other teams. | |
Scenario: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Two types of documents (well four, but two in this use case) | |
Roles: | |
{ | |
"_id": "role:00000390_student_11009_2010_AUT_U_1_S_group4", | |
"_rev": "1-82412c94266f8be1d4374313d586860d", | |
"doc_type": "role", | |
"source": "admin", | |
"status": "active", | |
"role_type": "student", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE 'AcademicSubjectAssociation' ( | |
'login' char(40) NOT NULL default '', | |
'subject' char(7) NOT NULL default '', | |
'year' int(11) NOT NULL default '2000', | |
'semester' char(10) NOT NULL default 'autumn', /* enum('autumn','winter','spring','summer') NOT NULL default 'autumn', */ | |
'association' char(10) NOT NULL default 'tutor', /*enum('coordinator','assessor','lecturer','tutor','liaison','marker','admin','markedit','other','listowner','proposer','propadmin') NOT NULL default 'tutor',*/ | |
UNIQUE ('login','subject','year','semester','association') | |
); | |
CREATE INDEX 'asa_login2' ON 'AcademicSubjectAssociation' ('login','subject','year','semester'); | |
CREATE INDEX 'asa_login3' ON 'AcademicSubjectAssociation' ('login','subject'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[minion@minion cgm]$ php tools/update_couch_design.php | |
Access granted. | |
Building staging design...done. | |
Uploading staging design...done. | |
Rebuilding all views (this may take a long time, you can track progress in the futon status window) ... done. Elapsed time: 12 seconds | |
Rebuilding lucene views (this may take a long time, too) ... done. Elapsed time: 8 seconds | |
Uploading production design...done. | |
Checking view signatures...done. Both signatures are: 7bfe586167ab93ee5c5320833b336201 | |
Testing a production view (this should be immediate) ...done. Elapsed time: 0 seconds | |
Testing a production lucene view (this should be immediate) ...done. Elapsed time: 8 seconds |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
.... | |
//Build and load the design into an object | |
echo "Building staging design..."; | |
chdir('../install/couchapp'); | |
$ddocstr = shell_exec('couchapp push --export'); | |
$ddoc = json_decode($ddocstr); | |
$ddoc_staging = clone $ddoc; |
OlderNewer