This file contains 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
//TO USE JUST save it and FIRE node <filename.js> | |
//AT THE BOTTOM THERE ARE TWO URL'S. TEST CASE IS FOR URL POINTING TO SUN'S JAVADOC ,A PAGE THAT MAKEE HEAVY //USE OF IFRAMES | |
// Should process HTML text and dump it on terminal | |
// Error on terminal with a backtrace | |
/* | |
/home/sid/opt/lib/node/.npm/jsdom/0.1.20/package/lib/jsdom/level2/html.js:1400 | |
this._contentDocument = new HTMLDocument(); | |
^ | |
ReferenceError: HTMLDocument is not defined | |
at Object.contentDocument (/home/sid/opt/lib/node/.npm/jsdom/0.1.20/package/lib/jsdom/level2/html.js:1400:9) |
This file contains 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
var request = require('request'), | |
jsdom = require('jsdom'), | |
net = require('net'), | |
DocumentSaver = require('./scrobblepage.js'), | |
filter = require('./documentfilter.js'); | |
exports.handleRequests = function(response, URLlst){ | |
//Crawl a page, gather text, filter it |
This file contains 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
for(doc=0 ; doc<this.docs.length; doc++ ){ | |
var self = this; | |
//Need to scale as too many connections are formed too quickly.. Server will drown... | |
(function testServer(data, docnum){ | |
if(self.openConn < 300){ | |
var s = new net.Stream(); | |
s.setEncoding('utf8'); | |
s.on('connect', function(){ |
This file contains 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
for(doc=0 ; doc<this.docs.length; doc++ ){ | |
var self = this; | |
//Need to scale as too many connections are formed too quickly.. Server will drown...\ | |
//Suggested: process all the data through a Queue and an interval... | |
//The counter implementation is flaky... | |
(function testServer(data, docnum){ | |
if(self.openConn < 300){ | |
var s = new net.Stream(); |
This file contains 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
for(doc=0 ; doc<this.docs.length; doc++ ){ | |
var self = this; | |
//Need to scale as too many connections are formed too quickly.. Server will drown...\ | |
//Suggested: process all the data through a Queue and an interval... | |
//The counter implementation is flaky... | |
(function testServer(data, docnum){ | |
var s = new net.Stream(); |
This file contains 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
void static closeOnComplete(struct evbuffer *buffer, | |
const struct evbuffer_cb_info *info, void *arg){ | |
struct total_processed *tp = (total_processed *)arg; | |
size_t towrite_n = tp->n; | |
size_t drained = info->n_deleted; | |
if(drained >= (towrite_n -1)){ | |
//close the socket connection... | |
cout<<"***Done with draining***"<<endl; | |
cout<<drained<<" out of "<<towrite_n<<" bytes drained"<<endl; |
This file contains 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
consumer = module.exports = function() { | |
this.q = []; | |
this.pr = []; | |
var self = this; | |
this.getQ = function(){ | |
return this.q; | |
}; | |
this.on('consume', function(){ | |
var arr_t = self.q.pop(); | |
}); |
This file contains 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
namespace PandoraSmuggler | |
{ | |
partial class PandoraSmuggler | |
{ | |
/// <summary> | |
/// Required designer variable. | |
/// </summary> | |
private System.ComponentModel.IContainer components = null; | |
/// <summary> |
This file contains 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
var sbAccordian = new Ext.Panel({ | |
title: 'Manage Something', | |
layout:'accordion', | |
layoutConfig: { | |
// layout-specific configs go here | |
titleCollapse: false, | |
animate: true | |
//activeOnTop: true | |
}, | |
items: [{ |
This file contains 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
/**Tree Panel with search bar...*/ | |
var SBTreePanel = function(){ | |
SBTreePanel.superclass.constructor.call(this, { | |
id:'sbooktreepanel', | |
region:'west', | |
split:true, | |
width: 280, | |
minSize: 175, | |
collapsible: true, | |
rootVisible:false, |
OlderNewer