Skip to content

Instantly share code, notes, and snippets.

View kovyrin's full-sized avatar

Oleksiy Kovyrin kovyrin

View GitHub Profile
--- constraints_parser.c (revision 57)
+++ constraints_parser.c (working copy)
@@ -392,14 +392,14 @@
// Check all tables
for (i = 0; i < table_definitions_cnt; i++) {
// Get table info
- table_def_t table = table_definitions[i];
- if (debug) printf(" (%s) ", table.name);
+ table_def_t *table = &(table_definitions[i]);
+ if (debug) printf(" (%s) ", table->name);
--- constraints_parser.c (revision 59)
+++ constraints_parser.c (working copy)
@@ -230,8 +230,9 @@
len = offs += field->fixed_length;
}
resolved:
+ offs &= 0xffff;
if (rec + offs - page > UNIV_PAGE_SIZE) {
- if (debug) printf("Invalid offset for field %li: %li\n", i, offs);
+ if (debug) printf("Invalid offset for field %lu: %lu\n", i, offs);
root@loops:/var/log# curl --HEAD http://127.0.0.1:8000/word/document_url/6417541
HTTP/1.1 302 Moved Temporarily
Connection: close
Date: Mon, 06 Oct 2008 23:55:01 GMT
Set-Cookie: _scribd_session=BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%250ASGFzaHsABjoKQHVzZWR7AA%253D%253D--f04a5432060febfe36092a7e2b74525af0d4a01b; domain=.scribd.com; path=/; expires=Sun, 01 Jan 2017 06:00:00 GMT
Status: 302 Found
Location: http://www.market-research-report.com/Merchant2/merchant.mvc?Store_Code=analysis&AFFIL=scribd2121&Screen=PROD&Product_Code=imtc0264
X-Runtime: 0.01000
Cache-Control: no-cache
Server: Mongrel 1.1.5
~/work/scribd/git/scribd_search (excerpts_only)
[02:57] $ curl 'http://localhost:8080/scribd_search/search?query=test+policy&doc=1&doc=2'
{"request_number":17,"query":"test policy","query_time":270,"excerpts":[{"doc_id":1,"excerpt":"... in an experiment, the conventional statistical <b>test<\/b> for differential expression is the t-... as highly significant by a conventional t-<b>test<\/b>. In reality -- and as additional ... two original vectors, the probability of a <b>test<\/b> vector having a distance below some ..."},{"doc_id":2,"excerpt":"... is unquestionably among a country\u2019s more important <b>policy<\/b> decisions. The choice of exchange ... money supply. An independent monetary <b>policy<\/b> allows counter-cyclical management of ... rates over an independent monetary <b>policy<\/b>, and the developing countries were ..."}]}
~/work/scribd/git/scribd (master)
[14:57] $ cap tests deploy
* executing `tests'
triggering start callbacks for `deploy'
* executing `multistage:ensure'
* executing `deploy'
* executing `deploy:before_deploy'
* executing `deploy:before_before_deploy'
* executing `deploy:check_lock'
* executing "if [ -e /var/www/apps/collegelist/shared/system/lock.txt ]; then cat /var/www/apps/collegelist/shared/system/lock.txt; fi"
mysql> CREATE FUNCTION `xml_escape_with_br`( tagvalue VARCHAR(2000)) RETURNS varchar(2000) DETERMINISTIC BEGIN IF (tagvalue IS NULL) THEN RETURN null; END IF; RETURN REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE( tagvalue,'&','&amp;'), '<','&lt;'), '>','&gt;'), '"','&quot;'), '\'','&apos;'), '\n', '<br/>'); END$$
Query OK, 0 rows affected (0.00 sec)
mysql> DELIMITER ;
mysql> select xml_escape_with_br("<h1>hello, world!</h1>\n<p>We say: 'Alexey & Tikhon rock!'");
+-----------------------------------------------------------------------------------------------+
| xml_escape_with_br("<h1>hello, world!</h1>\n<p>We say: 'Alexey & Tikhon rock!'") |
+-----------------------------------------------------------------------------------------------+
| &lt;h1&gt;hello, world!&lt;/h1&gt;<br/>&lt;p&gt;We say: &apos;Alexey &amp; Tikhon rock!&apos; |
+-----------------------------------------------------------------------------------------------+
1 row in set (0.04 sec)
#!/usr/bin/env ruby
require 'thrift'
$:.push(File.dirname(__FILE__) + "/../src/gen-rb")
require 'FastQueue_constants'
require 'FastQueue'
# Talk to a server via TCP sockets, using a binary protocol
location ~ ^/upload/(bulk_1|java_bulk_1|single|rev_upload)$ {
error_log logs/upload.scribd.error.log info;
access_log logs/upload.scribd.access.log main;
set $upload_uri $uri?$args;
if ($request_method = GET) {
rewrite .* /internal_upload last;
}
# Pass altered request body to this location
diff --git a/vendor/plugins/db-charmer/lib/db_charmer/connection_proxy.rb b/vendor/plugins/db-charmer/lib/db_charmer/connection_proxy.rb
index b2a6959..ac583f5 100644
--- a/vendor/plugins/db-charmer/lib/db_charmer/connection_proxy.rb
+++ b/vendor/plugins/db-charmer/lib/db_charmer/connection_proxy.rb
@@ -1,14 +1,14 @@
module DbCharmer
class ConnectionProxy < BlankSlate
- @@abstract_connection_class = nil
+ @abstract_connection_class = nil
>> CopyrightMatch.first.infringing_upload
=> #<WordUpload id: 3982, original_filename: "(ebook-pdf) philosophy - encyclopedia of philosophy...", extension: "pdf", word_count: 2141763, character_count: 10615093, character_count_with_spaces: 12741973, line_count: 166461, paragraph_count: 14554, page_count: 3901, guid: "a8npts30ukbo0", word_bulk_upload_id: 358, word_user_id: 665, sentence_count: 75822, md5: "141bf3c9fa1e319643f775bf87caa24e", copyright_match: 0, language_id: 1, slurp: nil, encrypted: 0, college: nil, keywords: nil, college_id: nil, created_at: "2007-03-06 23:23:34">
>> CopyrightMatch.first.infringing_upload.word_document
=> #<WordDocument id: 3965, word_upload_id: 3982, title: "(ebook-pdf) philosophy - encyclopedia of philosophy...", description: "", authors_note: nil, word_user_id: 665, created_at: "2007-03-07 00:23:34", default_format: 0, copyright_id: 1, word_download: 1, text_download: 1, printfu: 1, converted: 1, submitted: 1, show_comments: 1, removal_id: 100, published: 0, deleted: 0, sla