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
#pragma once | |
#include <cassert> | |
#include <ctime> | |
#define ISLEAP(x) (((x) % 4 == 0 && (x) % 100 != 0) || ((x) % 400 == 0)) | |
#define LEAPDELTA(x, y) ((ISLEAP(x) && (y) >= 2) ? 86400 : 0) | |
time_t mktime_quick(struct tm const &p) | |
{ |
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
#ifdef SHELL | |
g++ -Wall -Werror -g -I../../cclib/rapidjson/include $0 && ./a.out | |
exit 0 | |
#endif | |
// Output is: | |
// {"project":"rapidjson","stars":11} | |
// {"Name":"XYZ","Rollnumer":2,"array":["hello","world"],"Marks":{"Math":"50","Science":"70","English":"50","Social Science":"70"}} | |
// {"FromEmail":"[email protected]","FromName":"Sender's name","Subject":"My subject","Recipients":[{"Email":"[email protected]"}],"Text-part":"this is my text"} |
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
import redis | |
import web | |
SESSION = 'SESSION:' | |
class RedisStore(web.session.Store): | |
"""Store for saving a session in redis: | |
import rediswebpy | |
session = web.session.Session(app, rediswebpy.RedisStore(), initializer={'count': 0}) |