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 underscore = require('underscore') | |
var mongoose = require('mongoose'); | |
mongoose.connect('mongodb://localhost/db'); | |
var Schema = mongoose.Schema, | |
ObjectId = Schema.ObjectId; | |
var userSchema = new Schema({ | |
username: String, | |
displayname: String, |
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 underscore = require('underscore') | |
var mongoose = require('mongoose'); | |
mongoose.connect('mongodb://localhost/convflowdev_trial'); | |
console.log("chal para"); | |
var db = mongoose.connection; | |
db.on('error', console.error.bind(console, 'connection error:')); | |
db.once('open', function callback () { | |
// yay! | |
}); |
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 unittest | |
from similar_users_update_with_user_network import select_no_of_users, count_keywords, network_participants, user_activity_count, find_similiar_problems, distribute_list_and_count_activity_index | |
from bson.objectid import ObjectId | |
from db_entries import all_problems, all_users | |
import datetime | |
from pymongo import MongoClient | |
client = MongoClient('localhost',27017) | |
db = client['convflowdev_trial_new'] | |
problems = db['problems'] |
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
from pymongo import MongoClient | |
import datetime | |
client = MongoClient('localhost',27017) | |
db = client['convflowdev_trial'] | |
problems = db['problems'] | |
users = db['users'] | |
def count_keywords(posted_problem_keywords,search_problem_keywords): |
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 unittest | |
from similar_users_update_with_user_network import * | |
from bson.objectid import ObjectId | |
class convflowDB(unittest.TestCase): | |
def test_count_keywords(self): | |
self.assertEqual(count_keywords([],[]),0) | |
self.assertEqual(count_keywords(['ab'],['ba']),0) | |
self.assertEqual(count_keywords(['ab'],['ab']),1) |
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
from pymongo import MongoClient | |
import datetime | |
client = MongoClient('localhost',27017) | |
db = client['convflowdev_trial'] | |
problems = db['problems'] | |
users = db['users'] | |
def count_keywords(posted_problem_keywords,search_problem_keywords): |
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 pymongo | |
import datetime | |
from bson.objectid import ObjectId | |
import random | |
import re | |
import json | |
import urllib | |
client = MongoClient('localhost',27017) | |
db = client['convflowdev_trial'] |
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
from pymongo import MongoClient | |
import datetime | |
client = MongoClient('localhost',27017) | |
db = client['convflowdev_trial'] | |
problems = db['problems'] | |
users = db['users'] | |
def count_keywords(posted_problem_keywords,search_problem_keywords): |
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
from pymongo import MongoClient | |
import datetime | |
client = MongoClient('localhost',27017) | |
db = client['convflowdev'] | |
problems = db['problems'] | |
users = db['users'] | |
def count_keywords(posted_problem_keywords,search_problem_keywords): | |
count = 0 |
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
from pymongo import MongoClient | |
import datetime | |
client = MongoClient('localhost',27017) | |
db = client['convflowdev'] | |
problems = db['problems'] | |
users = db['users'] | |
def count_keywords(posted_problem_keywords,search_problem_keywords): |