I hereby claim:
- I am mumrah on github.
- I am mumrah (https://keybase.io/mumrah) on keybase.
- I have a public key whose fingerprint is 557C E8A2 3280 9E50 77A5 FE17 76D0 486F D3CE E771
To claim this, I am signing this object:
#include <stdlib.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <string.h> | |
#include <signal.h> | |
char *memory; | |
void signal_handler(int signo) | |
{ |
I hereby claim:
To claim this, I am signing this object:
function get_weather_history(year, month, day, query, apikey) { | |
if(month < 10) { | |
month = "0" + month; | |
} | |
if(day < 10) { | |
day = "0" + day; | |
} | |
var ymd = year + "" + month + "" + day; | |
var url = "http://api.wunderground.com/api/" + apikey + "/history_" + ymd + "/q/" + query + ".json"; |
[ { | |
"id" : "12", | |
"fields" : [ { | |
"name" : "url", | |
"value" : [ { | |
"name" : "url", | |
"value" : "https://lucidimagination.zendesk.com/api/v2/tickets/12.json" | |
} ] | |
}, { | |
"name" : "id", |
function get_weather_conditions(year, month, day, query, apikey, cache_buster) { | |
if(month < 10) { | |
month = "0" + month; | |
} | |
if(day < 10) { | |
day = "0" + day; | |
} | |
var ymd = year + "" + month + "" + day; | |
var url = "http://api.wunderground.com/api/" + apikey + "/history_" + ymd + "/q/" + query + ".json"; |
fs.readFile('static/grid.html', 'ascii').addCallback(function(data){ | |
sys.debug('test'); | |
}); |
#include "stdio.h" | |
int* foo(){ | |
static int out[2] = {1,2}; | |
return out; | |
} | |
int main(int argv, char* argc){ | |
int* bar = foo(); | |
printf("%p\n", bar); | |
printf("%d %d\n", bar[0], bar[1]); |
var fs = require('fs'); | |
var url = require('url'); | |
var sys = require('sys'); | |
var http = require('http'); | |
require('./ejs'); // EJS, http://embeddedjs.com/ | |
/* | |
* Server-side controller methods | |
*/ |
var _deref = function (doc, field, col) { | |
var oid = ObjectId(doc[field]); | |
delete doc[field]; | |
doc[field] = db[col].findOne({_id:oid}); | |
return doc; | |
} | |
var deref = function(field, collection){ | |
// C-C-C-Closure!! | |
return function(doc){ |
>>> x = {'a':1,'b':"foo",'c':ObjectId()} | |
>>> print x | |
{'a': 1, 'c': ObjectId('4c4f4f5e2554c813e4000001'), 'b': 'foo'} | |
>>> print json.dumps(x) | |
Traceback (most recent call last): | |
[...] | |
TypeError: ObjectId('4c4f4f5e2554c813e4000001') is not JSON serializable | |
>>> print json.dumps(x, cls=MongoEncoder) | |
'{"a": 1, "c": ObjectId("4c4f4f5e2554c813e4000001"), "b": "foo"}' |