Skip to content

Instantly share code, notes, and snippets.

// sm.cpp
#define XP_UNIX
#include "mozjs/jsapi.h"
#include <string>
#include <string.h>
#include <assert.h>
#include <malloc.h>
/* The class of the global object. */
from pymongo.connection import Connection , ConnectionFailure
import datetime
try:
connection = Connection("localhost", 27017)
except ConnectionFailure:
page_content = """<span class = "error">could not connect connect:besure that Mongo is running on localhost:27017</span>"""
except Exception, detail:
page_content = """<span class = "error">could not connect connect:besure that Mongo is running on localhost:27017</span>"""
from pymongo.connection import Connection , ConnectionFailure
import datetime
try:
connection = Connection("localhost", 27017)
except ConnectionFailure:
page_content = """<span class = "error">could not connect connect:besure that Mongo is running on localhost:27017</span>"""
except Exception, detail:
page_content = """<span class = "error">could not connect connect:besure that Mongo is running on localhost:27017</span>"""