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
I want to use a function so that i dont have to write the same logic over and over again in my calls to the find function on my MongoDb collections. | |
Here's the function I want, but notice that it contains 'self.res'. That's cause i just ripped it out of my find(...) call (below). Previously, when this was just an annoymous function, self.res is the HTTP response that we're building. | |
So how to i access self.res in my callback, if I use a named function, instead of an anonymous function in my find? | |
function findHandler(err, docs) { | |
if (!err) { | |
// Return Success & JSON Content-type | |
var length = docs.length; |
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
function findHandler(err, docs) { | |
if (!err) { | |
// Return Success & JSON Content-type | |
var length = docs.length; | |
writeMeta(self.res,200,url,length); | |
// Process results from Mongo | |
docs.forEach(function(e,i,a) { | |
//console.log(e,i,a); |
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
gw@airy ~/Code> vim /Users/gw/Library/Logs/TileMill.log | |
node.js:201 | |
throw e; // process.nextTick error, or 'error' event on first tick | |
^ | |
node.js:201 | |
throw e; // process.nextTick error, or 'error' event on first tick |
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
When I execute this URL in my browser: | |
http://query.yahooapis.com/v1/public/yql?q=insert%20into%20piratespeak.dictionary%20(english_term%2C%20pirate_term)%20values%20(%22up%22%2C%20%22aloft%22)%3B&format=json&env=store%3A%2F%2Fkid666.com%2Fpiratespeak&callback=cbfunc | |
I get this response: | |
cbfunc({"query":{"count":1,"created":"2012-09-14T19:42:19Z","lang":"en-US","results":{"result":"Ahoy mate! Ye doth added ye Pirate term \"aloft\" for yonder English term \"up\""}}}); | |
It looks good, but if i go back to the console and get the URL to list everything in piratespeak.dictionary, |
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
/Users/gw/Code/douche/lib/douche/wsdl.js:48 | |
var name = operation_tag['@']['name']; | |
^ | |
TypeError: Cannot read property 'name' of undefined | |
at WSDL._read_xml (/Users/gw/Code/douche/lib/douche/wsdl.js:50:34) | |
at WSDL.parse (/Users/gw/Code/douche/lib/douche/wsdl.js:21:10) | |
at IncomingMessage.WSDL._get (/Users/gw/Code/douche/lib/douche/wsdl.js:108:7) | |
at IncomingMessage.EventEmitter.emit (events.js:115:20) | |
at IncomingMessage._emitEnd (http.js:366:10) | |
at HTTPParser.parserOnMessageComplete [as onMessageComplete] (http.js:149:23) |
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
gw@airy ~/> java Reps | |
a: 1.0 | |
b: 0.35 | |
c: 0.65 | |
d: 0.35 | |
e: 0.035 | |
f: 0.034999999999999996 | |
g: 0.06999999999999999 |
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
<project name="comFidessaUstpPairsDialogUtil" default="main" basedir="."> | |
<property environment="env"/> | |
<property name="srcDir" value="${basedir}/src"/> | |
<property name="bldDir" value="${basedir}/build"/> | |
<property name="jarDir" value="${env.CASE}/regional/classes"/> | |
<path id="case.jar"> | |
<pathelement path="${classpath}"/> |
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
"{ | |
u'priority': 6, | |
u'eta': u'2015-11-25T15: 27: 25.112018-05: 00', | |
u'request': { | |
u'args': u'[]', | |
u'time_start': None, | |
u'name': u'offline_processor.tasks.session_timer', | |
u'delivery_info': { | |
u'priority': None, | |
u'redelivered': False, |
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
<div id="page" class="hfeed site"> | |
<header id="masthead" class="site-header" role="banner"> | |
<nav role="navigation" class="site-navigation main-navigation"> | |
<h1 class="assistive-text">Menu</h1> | |
<div class="assistive-text skip-link"><a href="#content" title="Skip to content">Skip to content</a></div> | |
<div class="menu"><ul><li class="current_page_item"><a href="http://mainecivichackday.com/" title="Home">Home</a></li><li class="page_item page-item-1"><a href="http://mainecivichackday.com/about/">About</a></li><li class="page_item page-item-20"><a href="http://mainecivichackday.com/participate/">Participate</a></li><li class="page_item page-item-24"><a href="http://mainecivichackday.com/solve/">Solve</a></li><li class="page_item page-item-9"><a href="http://mainecivichackday.com/contact/">Contact</a></li></ul></div> | |
</nav><!-- .site-navigation .main-navigation --> | |
<hgroup> | |
<h1 class="site-title"><a href="http://mainecivichackday.com/" title="Maine Civic Hack Day" rel="home">Maine Civic Hack |
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
this._commsAjax("pagedQuery", | |
data, | |
$.proxy(function(data) { | |
if (data.errorCode != 0) { | |
delete this._activeSess[sessionId]; | |
queryObj.error(data.errorText, data.errorCode); | |
} | |
}, this) | |